GskPacketQueueFd

GskPacketQueueFd — A PacketQueue based on a file descriptor.

Synopsis

                    GskPacketQueueFd;
GskPacketQueue *    gsk_packet_queue_fd_new             (int fd);
GskPacketQueue *    gsk_packet_queue_fd_new_by_family   (int addr_family,
                                                         GError **error);
GskPacketQueue *    gsk_packet_queue_fd_new_bound       (GskSocketAddress *address,
                                                         GError **error);
gboolean            gsk_packet_queue_fd_set_broadcast   (GskPacketQueueFd *packet_queue_fd,
                                                         gboolean allow_broadcast,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GskIO
         +----GskPacketQueue
               +----GskPacketQueueFd

Properties

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

Description

A datagram client or server.

Details

GskPacketQueueFd

typedef struct _GskPacketQueueFd GskPacketQueueFd;


gsk_packet_queue_fd_new ()

GskPacketQueue *    gsk_packet_queue_fd_new             (int fd);

Create a new GskPacketQueue from an already opened file-descriptor.

fd :

the datagram socket file-descriptor.

Returns :

the new packet-queue.

gsk_packet_queue_fd_new_by_family ()

GskPacketQueue *    gsk_packet_queue_fd_new_by_family   (int addr_family,
                                                         GError **error);

Create a new Packet Queue using a newly opened datagram socket of a given address family. The address family is the sequence of AF_ defines in the header <sys/socket.h> on most unices.

The address family of a GskSocketAddress may be found using gsk_socket_address_protocol_family().

addr_family :

the system-specific address family.

error :

optional pointer to an error to set if things go wrong.

Returns :

the new packet-queue, or NULL if there is a problem creating the socket.

gsk_packet_queue_fd_new_bound ()

GskPacketQueue *    gsk_packet_queue_fd_new_bound       (GskSocketAddress *address,
                                                         GError **error);

Create a new Packet Queue using a newly opened datagram socket which is bound to a given address.

Note that socket address space for TCP and UDP is separate, so it's allowed (and sometimes encouraged) to bind to the same port for both a packet queue, and a stream-listener.

address :

the address to bind to.

error :

optional pointer to an error to set if things go wrong.

Returns :

the new packet-queue, or NULL if there is a problem creating the socket or binding.

gsk_packet_queue_fd_set_broadcast ()

gboolean            gsk_packet_queue_fd_set_broadcast   (GskPacketQueueFd *packet_queue_fd,
                                                         gboolean allow_broadcast,
                                                         GError **error);

Changes the operating-system-level flag of whether sends and receives of broadcast packets are allowed on datagram sockets.

packet_queue_fd :

the packet-queue to affect.

allow_broadcast :

whether to allow (TRUE) or disallow broadcast sends and receives. The default for a new datagram socket is to disallow broadcast packets.

error :

optional address of an error to set if things go wrong.

Returns :

whether the operation was successful.

Property Details

The "file-descriptor" property

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

for reading and/or writing.