Home | History | Annotate | Download | only in telephony

Lines Matching full:channel

180     SysChannel  channel = _s_free_channels;
181 if (channel != NULL) {
182 _s_free_channels = channel->next;
183 channel->next = NULL;
184 channel->fd = -1;
185 channel->callback = NULL;
186 channel->opaque = NULL;
188 return channel;
192 sys_channel_free( SysChannel channel )
194 if (channel->fd >= 0) {
195 socket_close( channel->fd );
196 channel->fd = -1;
198 channel->next = _s_free_channels;
199 _s_free_channels = channel;
206 SysChannel channel = _channel;
207 D( "%s: read event for channel %p:%d\n", __FUNCTION__,
208 channel, channel->fd );
209 channel->callback( channel->opaque, SYS_EVENT_READ );
215 SysChannel channel = _channel;
216 D( "%s: write event for channel %p:%d\n", __FUNCTION__, channel, channel->fd );
217 channel->callback( channel->opaque, SYS_EVENT_WRITE );
221 sys_channel_on( SysChannel channel,
235 channel->callback = event_callback;
236 channel->opaque = event_opaque;
237 qemu_set_fd_handler( channel->fd, read_handler, write_handler, channel );
241 sys_channel_read( SysChannel channel, void* buffer, int size )
247 int ret = socket_recv(channel->fd, buf, len);
268 sys_channel_write( SysChannel channel, const void* buffer, int size )
274 int ret = socket_send(channel->fd, buf, len);
293 void sys_channel_close( SysChannel channel )
295 qemu_set_fd_handler( channel->fd, NULL, NULL, NULL );
296 sys_channel_free( channel );
318 SysChannel channel = sys_channel_alloc();
320 channel->fd = socket_anyaddr_server( port, SOCKET_STREAM );
321 if (channel->fd < 0) {
324 sys_channel_free( channel );
328 D( "%s: server channel %p:%d now listening on port %d\n",
329 __FUNCTION__, channel, channel->fd, port );
331 return channel;
338 SysChannel channel = sys_channel_alloc();
340 D( "%s: creating handler from server channel %p:%d\n", __FUNCTION__,
343 channel->fd = socket_accept_any( server_channel->fd );
344 if (channel->fd < 0) {
346 sys_channel_free( channel );
351 socket_set_nodelay( channel->fd );
354 server_channel, server_channel->fd, channel, channel->fd );
356 return channel;
363 SysChannel channel = sys_channel_alloc();
365 channel->fd = socket_network_client( hostname, port, SOCKET_STREAM );
366 if (channel->fd < 0) {
367 sys_channel_free(channel);
372 socket_set_nonblock( channel->fd );
373 socket_set_nodelay( channel->fd );
375 return channel;