forked from Samsung/libtuv
-
Notifications
You must be signed in to change notification settings - Fork 0
Enabling tcp
SaeHie Park edited this page Aug 27, 2015
·
4 revisions
TCP structure uv_tcp_t inherits uv_stream_t
struct uv_tcp_s {
UV_HANDLE_FIELDS
UV_STREAM_FIELDS
UV_TCP_PRIVATE_FIELDS
};
- uv_tcp_init()
- calls uv__stream_init()
- uv__stream_init()
- calls uv__handle_init()
- initialises structure members
- calls uv__io_init() with stream->io_watcher and callback
uv__stream_io()
-
uv__io_init()
-
uv_tcp_open()
- calls uv__stream_open()
- uv__stream_open()
- sets stream->io_watcher.fd to socket
- uv_tcp_connect()
- calls uv__tcp_connect()
- uv__tcp_connect()
- calls uv__socket() to get socket
- calls uv__stream_open() with socket
- calls connect() with stream.fd which is socket
- calls uv__req_init() with
uv_connect_t
type connection requestreq
- sets connection callback to
req
- calls uv__io_start() with UV__POLLOUT
- uv__io_start()
- adds watcher to loop->watcher_queue
- uv_run()