#include <hawktracer/timeline.h>
#include <stddef.h>
Go to the source code of this file.
◆ HT_TCPListener
◆ ht_tcp_listener_callback()
◆ ht_tcp_listener_create()
◆ ht_tcp_listener_destroy()
◆ ht_tcp_listener_register()
Creates a tcp listener and registers it to a timeline.
This is a helper function that wrapps ht_tcp_listener_create() and ht_timeline_register_listener_full(). The user can achieve the same result by explicitly creating a listener and registering it to a timeline:
Please note the example above doesn't implement error handling, which would make the code even more complicated.
- Parameters
-
timeline | the timeline where the listener will be attached to. |
port | the port of the TCP server. |
buffer_size | a size of the internal buffer. |
out_err | a pointer to an error code variable where the error will be stored if the operation fails. |
- Returns
- a pointer to a new instance of the listener.
◆ ht_tcp_listener_stop()
Stops listening to new events.
The function is very similar to ht_tcp_listener_destroy() except it does not release the memory allocated for listener object. After stopping the listener, there's no way to resume it. User needs to create another listener and register it for the timeline instead.
- Parameters
-