bsocket

bsocket —

Synopsis




enum        BSocketOptions;
gboolean    b_socket_init                   (GError **error);
gint        b_socket_udp_new                (BSocketOptions options,
                                             GError **error);

Description

Details

enum BSocketOptions

typedef enum
{
  B_SO_NONE      = 0,
  B_SO_BROADCAST = 1 << 0,
  B_SO_REUSEADDR = 1 << 1
} BSocketOptions;

B_SO_NONE no options
B_SO_BROADCASTsend and receive broadcast packages
B_SO_REUSEADDRallow the address and port to be reused

b_socket_init ()

gboolean    b_socket_init                   (GError **error);

Initialize network sockets. This function does nothing on UNIXes. On Win32 it initializes the Winsock DLL. You may call this function any number of times, the initialization is only done once.

error : return location for possible errors.
Returns : TRUE on success, FALSE in case of an error

b_socket_udp_new ()

gint        b_socket_udp_new                (BSocketOptions options,
                                             GError **error);

Creates an UDP socket and configures it according to options.

options : BSocketOptions to set on the socket.
error : return location for possible errors.
Returns : a socket descriptor or -1 in case of an error