Airframe Application Utilities
libairframe 2.12.0 API documentation

Data Structures | Typedefs | Functions
mio_source_tcp.h File Reference

MIO passive TCP socket source initializer. More...

#include <airframe/mio.h>

Go to the source code of this file.

Data Structures

struct  _MIOSourceTCPConfig
 TCP source configuration context. More...
 

Typedefs

typedef struct _MIOSourceTCPConfig MIOSourceTCPConfig
 TCP source configuration context. More...
 

Functions

gboolean mio_source_init_tcp (MIOSource *source, const char *spec, MIOType vsp_type, void *cfg, GError **err)
 Initialize a source for reading from a passive TCP socket. More...
 

Detailed Description

MIO passive TCP socket source initializer.

Most applications should use the interface in mio_config.h to access this initializer.

Typedef Documentation

◆ MIOSourceTCPConfig

TCP source configuration context.

Pass as the cfg argument to mio_source_init_tcp().

Function Documentation

◆ mio_source_init_tcp()

gboolean mio_source_init_tcp ( MIOSource source,
const char *  spec,
MIOType  vsp_type,
void *  cfg,
GError **  err 
)

Initialize a source for reading from a passive TCP socket.

This source supports single-threaded, sequential access only; clients connecting to an application using this source may be refused connection while the application is servicing a previously connected client.

Parameters
sourcepointer to MIOSource to initialize. This MIOSource will be overwritten.
specinput specifier to initialize MIOSource with. Must be a service specifier of the form "[host,]service" where host is the IPv4 or IPv6 name or address of an interface to bind to, or * to bind to all interfaces, and service is a service name or TCP port number to bind to. If omitted, host is assumed to be *. If spec is NULL, host is assumed to be * and service is taken from the cfg paramater.
vsp_typerequested source pointer type, or MIO_T_ANY for default.
cfgpointer to configuration context. Must be a pointer to an MIOSourceTCPConfig structure.
errAn error description pointer.
Returns
TRUE if the MIOSource was successfully initialized.