61 #define TRANSPORT_FD_INVALID ((evutil_socket_t) -1) |
61 #define TRANSPORT_FD_INVALID ((evutil_socket_t) -1) |
62 |
62 |
63 /** |
63 /** |
64 * Implementation of transport_methods::read |
64 * Implementation of transport_methods::read |
65 */ |
65 */ |
66 err_t transport_fd_methods_read (transport_t *transport, void *buf, size_t *len, error_t *err); |
66 err_t transport_fd__read (transport_t *transport, void *buf, size_t *len, error_t *err); |
67 |
67 |
68 /** |
68 /** |
69 * Implementation of transport_methods::write. |
69 * Implementation of transport_methods::write. |
70 * |
70 * |
71 * If this gets EAGAIN, it will automatically enable the write event, unless masked out. |
71 * If this gets EAGAIN, it will automatically enable the write event, unless masked out. |
72 */ |
72 */ |
73 err_t transport_fd_methods_write (transport_t *transport, const void *buf, size_t *len, error_t *err); |
73 err_t transport_fd__write (transport_t *transport, const void *buf, size_t *len, error_t *err); |
74 |
74 |
75 /** |
75 /** |
76 * Implementation of transport_methods::events. |
76 * Implementation of transport_methods::events. |
77 * |
77 * |
78 * For TRANSPORT_READ, this will simply apply enable/disable as given. |
78 * For TRANSPORT_READ, this will simply apply enable/disable as given. |
79 * |
79 * |
80 * For TRANSPORT_WRITE, the write event will only be enabled if given in the mask, *and* the ev_write event is currently |
80 * For TRANSPORT_WRITE, the write event will only be enabled if given in the mask, *and* the ev_write event is currently |
81 * active (via transport_fd_methods_write()); otherwise, the write event will not be enabled. |
81 * active (via transport_fd_methods_write()); otherwise, the write event will not be enabled. |
82 */ |
82 */ |
83 err_t transport_fd_methods_events (transport_t *transport, short mask, error_t *err); |
83 err_t transport_fd__events (transport_t *transport, short mask, error_t *err); |
|
84 |
|
85 /** |
|
86 * Implementation of transport_methods::deinit. |
|
87 * |
|
88 * This simply calls transport_fd_deinit(). |
|
89 */ |
|
90 void transport_fd__deinit (transport_t *transport); |
84 |
91 |
85 /** |
92 /** |
86 * A transport_fd_callback_func that simply invokes the transport_callback user functions. |
93 * A transport_fd_callback_func that simply invokes the transport_callback user functions. |
87 * |
94 * |
88 * Register with a NULL cb_arg. |
95 * Register with a NULL cb_arg. |
153 * Close an opened fd, releasing all resources within our state. |
160 * Close an opened fd, releasing all resources within our state. |
154 */ |
161 */ |
155 err_t transport_fd_close (struct transport_fd *fd); |
162 err_t transport_fd_close (struct transport_fd *fd); |
156 |
163 |
157 /** |
164 /** |
158 * Destroy the fd immediately. |
165 * Deinitialize the transport_fd. |
159 * |
166 * |
160 * This logs a warning if the close() fails. |
167 * This logs a warning if the close() fails. |
161 * |
168 * |
162 * XXX: this may actually block, I think? SO_LINGER? |
169 * XXX: this may actually block, I think? SO_LINGER? |
163 */ |
170 */ |
164 void transport_fd_destroy (struct transport_fd *fd); |
171 void transport_fd_deinit (struct transport_fd *fd); |
165 |
172 |
166 #endif |
173 #endif |