equal
deleted
inserted
replaced
15 */ |
15 */ |
16 static void sock_tcp_event_handler (evutil_socket_t fd, short what, void *arg) |
16 static void sock_tcp_event_handler (evutil_socket_t fd, short what, void *arg) |
17 { |
17 { |
18 struct sock_tcp *sock = arg; |
18 struct sock_tcp *sock = arg; |
19 |
19 |
|
20 (void) fd; |
|
21 |
20 // invoke appropriate callback |
22 // invoke appropriate callback |
21 sock_stream_invoke_callbacks(SOCK_TCP_BASE(sock), what); |
23 sock_stream_invoke_callbacks(SOCK_TCP_BASE(sock), what); |
22 } |
24 } |
23 |
25 |
24 /* |
26 /* |
109 |
111 |
110 /* |
112 /* |
111 * Our sock_stream_type |
113 * Our sock_stream_type |
112 */ |
114 */ |
113 struct sock_stream_type sock_tcp_type = { |
115 struct sock_stream_type sock_tcp_type = { |
114 .methods.read = &sock_tcp_read, |
116 .methods = { |
115 .methods.write = &sock_tcp_write, |
117 .read = &sock_tcp_read, |
116 .methods.event_init = &sock_tcp_event_init, |
118 .write = &sock_tcp_write, |
117 .methods.event_enable = &sock_tcp_event_enable, |
119 .event_init = &sock_tcp_event_init, |
|
120 .event_enable = &sock_tcp_event_enable, |
|
121 }, |
118 }; |
122 }; |
119 |
123 |
120 err_t sock_tcp_alloc (struct sock_tcp **sock_ptr) |
124 err_t sock_tcp_alloc (struct sock_tcp **sock_ptr) |
121 { |
125 { |
122 // alloc |
126 // alloc |