-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathuv_zsock.h
42 lines (32 loc) · 822 Bytes
/
uv_zsock.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef UV_ZSOCK_H_
#define UV_ZSOCK_H_
#include <uv.h>
#ifdef __cplusplus
extern "C" {
#endif
struct uv_zsock_s;
typedef struct uv_zsock_s uv_zsock_t;
typedef void (*uv_zsock_cbfn)(uv_zsock_t *handle, int revents);
typedef void (*uv_zsock_close_cbfn)(uv_zsock_t*);
struct uv_zsock_s
{
void *data; // rw
uv_loop_t *loop; // ro
void *zsock; // read-only
uv_zsock_cbfn cb; // read-only
int events; // read-only
// private
uv_zsock_close_cbfn close_cb;
uv_prepare_t w_prepare;
uv_check_t w_check;
uv_idle_t w_idle;
uv_poll_t w_poll;
};
void uv_zsock_init(uv_loop_t *loop, uv_zsock_t *wz, void *zsock);
void uv_zsock_start(uv_zsock_t *wz, uv_zsock_cbfn cb, int events);
void uv_zsock_stop(uv_zsock_t *wz);
void uv_zsock_close(uv_zsock_t *wz, uv_zsock_close_cbfn cb);
#ifdef __cplusplus
}
#endif
#endif