InfdTcpServer

InfdTcpServer

Synopsis




enum                InfdTcpServerStatus;
                    InfdTcpServer;
                    InfdTcpServerClass;
gboolean            infd_tcp_server_open                (InfdTcpServer *server,
                                                         GError **error);
void                infd_tcp_server_close               (InfdTcpServer *server);

Object Hierarchy


  GObject
   +----InfdTcpServer

Properties


  "io"                       InfIo*                : Read / Write / Construct Only
  "local-address"            InfIpAddress*         : Read / Write
  "local-port"               guint                 : Read / Write
  "status"                   InfdTcpServerStatus   : Read

Signals


  "error"                                          : Run Last
  "new-connection"                                 : Run Last

Description

Details

enum InfdTcpServerStatus

typedef enum _InfdTcpServerStatus {
  INFD_TCP_SERVER_CLOSED,
  INFD_TCP_SERVER_OPEN
} InfdTcpServerStatus;


InfdTcpServer

typedef struct _InfdTcpServer InfdTcpServer;


InfdTcpServerClass

typedef struct {
  GObjectClass parent_class;

  /* Signals */
  void (*new_connection)(InfdTcpServer* server,
                         InfTcpConnection* connection);

  void (*error)(InfdTcpServer* server,
                GError* error);
} InfdTcpServerClass;


infd_tcp_server_open ()

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.

server :

A InfdTcpServer.

error :

Location to store error information.

Returns :


infd_tcp_server_close ()

void                infd_tcp_server_close               (InfdTcpServer *server);

Closes a TCP server that is open.

server :

A InfdTcpServer.

Property Details

The "io" property

  "io"                       InfIo*                : Read / Write / Construct Only

I/O handler.


The "local-address" property

  "local-address"            InfIpAddress*         : Read / Write

Address to bind to.


The "local-port" property

  "local-port"               guint                 : Read / Write

Port to bind to.

Allowed values: <= 65535

Default value: 0


The "status" property

  "status"                   InfdTcpServerStatus   : Read

Status of the TCP server.

Default value: INFD_TCP_SERVER_CLOSED

Signal Details

The "error" signal

void                user_function                      (InfdTcpServer *infdtcpserver,
                                                        gpointer       arg1,
                                                        gpointer       user_data)          : Run Last

infdtcpserver :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.

The "new-connection" signal

void                user_function                      (InfdTcpServer    *infdtcpserver,
                                                        InfTcpConnection *arg1,
                                                        gpointer          user_data)          : Run Last

infdtcpserver :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.