| libinfinity-0.3 Reference Manual | ||||
|---|---|---|---|---|
enum InfdTcpServerStatus; InfdTcpServer; InfdTcpServerClass; gboolean infd_tcp_server_open (InfdTcpServer *server, GError **error); void infd_tcp_server_close (InfdTcpServer *server);
"io" InfIo* : Read / Write / Construct Only "local-address" InfIpAddress* : Read / Write "local-port" guint : Read / Write "status" InfdTcpServerStatus : Read
typedef enum _InfdTcpServerStatus {
INFD_TCP_SERVER_CLOSED,
INFD_TCP_SERVER_OPEN
} InfdTcpServerStatus;
typedef struct {
GObjectClass parent_class;
/* Signals */
void (*new_connection)(InfdTcpServer* server,
InfTcpConnection* connection);
void (*error)(InfdTcpServer* server,
GError* error);
} InfdTcpServerClass;
gboolean infd_tcp_server_open (InfdTcpServer *server, GError **error);
Attempts to open server. If the "local-address" property is NULL, it will
bind on all interfaces on IPv4. If "local-port" is NULL, a random available
port will be assigned. If the function fails, FALSE is returned and error
is set.
|
A InfdTcpServer. |
|
Location to store error information. |
Returns : |
void infd_tcp_server_close (InfdTcpServer *server);
Closes a TCP server that is open.
|
A InfdTcpServer. |
"local-port" property"local-port" guint : Read / Write
Port to bind to.
Allowed values: <= 65535
Default value: 0
"status" property"status" InfdTcpServerStatus : Read
Status of the TCP server.
Default value: INFD_TCP_SERVER_CLOSED
"error" signalvoid user_function (InfdTcpServer *infdtcpserver, gpointer arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"new-connection" signalvoid user_function (InfdTcpServer *infdtcpserver, InfTcpConnection *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |