GskStreamListenerSocket

GskStreamListenerSocket — socket-based stream-listener.

Synopsis




            GskStreamListenerSocket;
GskStreamListener* gsk_stream_listener_socket_new_bind
                                            (GskSocketAddress *address,
                                             GError **error);
GskStreamListener* gsk_stream_listener_socket_new_bind_full
                                            (GskSocketAddress *address,
                                             GskStreamListenerSocketFlags flags,
                                             GError **error);
void        gsk_stream_listener_socket_set_backlog
                                            (GskStreamListenerSocket *lis,
                                             guint backlog);
GskStreamListener* gsk_stream_listener_socket_new_from_fd
                                            (int fd,
                                             GError **error);
#define     GSK_STREAM_LISTENER_SOCKET_USE_GLIB_MAIN_LOOP

Object Hierarchy


  GObject
   +----GskStreamListener
         +----GskStreamListenerSocket

Properties


  "file-descriptor"      GskFd                 : Read / Write / Construct Only
  "listening-address"    GskSocketAddress      : Read / Write / Construct Only
  "may-reuse-address"    gboolean              : Read / Write / Construct Only
  "unlink-when-done"     gboolean              : Read / Write

Description

This is a GskStreamListener that takes new input streams from a raw socket.

Details

GskStreamListenerSocket

typedef struct _GskStreamListenerSocket GskStreamListenerSocket;

An instance of a socket-based GskStreamListener.


gsk_stream_listener_socket_new_bind ()

GskStreamListener* gsk_stream_listener_socket_new_bind
                                            (GskSocketAddress *address,
                                             GError **error);

Create a new listener bound to a specific socket-address.

address : the address that the listener should be bound to.
error : optional location to store error at.
Returns : the newly created stream-listener.

gsk_stream_listener_socket_new_bind_full ()

GskStreamListener* gsk_stream_listener_socket_new_bind_full
                                            (GskSocketAddress *address,
                                             GskStreamListenerSocketFlags flags,
                                             GError **error);

Create a new listener bound to a specific socket-address.

If flags suggests GSK_SOCKET_LISTENER_STREAM_DONT_REUSE_ADDRESS, then the usual timeout rules about how often a port may be bound are ignored. This only really affects TCP/IP socket listeners.

address : the address that the listener should be bound to.
flags : flags controlling the operation of the listener.
error : optional location to store error at.
Returns : the newly created stream-listener.

gsk_stream_listener_socket_set_backlog ()

void        gsk_stream_listener_socket_set_backlog
                                            (GskStreamListenerSocket *lis,
                                             guint backlog);

Set the number of incoming connections that can be accepted before they are rejected outright.

lis : the listener whose backlog quota should be affected.
backlog : the number of incoming connections to accept before refusing them.

gsk_stream_listener_socket_new_from_fd ()

GskStreamListener* gsk_stream_listener_socket_new_from_fd
                                            (int fd,
                                             GError **error);

fd: The bound socket. error: optional location to store error at. returns: The newly created stream-listener.

Create a new listener for an already bound socket.

fd :
error :
Returns :

GSK_STREAM_LISTENER_SOCKET_USE_GLIB_MAIN_LOOP

#define GSK_STREAM_LISTENER_SOCKET_USE_GLIB_MAIN_LOOP	0

Property Details

The "file-descriptor" property

  "file-descriptor"      GskFd                 : Read / Write / Construct Only

whence to accept new connections on.


The "listening-address" property

  "listening-address"    GskSocketAddress      : Read / Write / Construct Only

The name others will use to connect.


The "may-reuse-address" property

  "may-reuse-address"    gboolean              : Read / Write / Construct Only

Whether a listening address may be reused as soon as it's closed.

Default value: TRUE


The "unlink-when-done" property

  "unlink-when-done"     gboolean              : Read / Write

Unlink the file from the file-system (only for local socket-listeners).

Default value: FALSE