![]() |
![]() |
![]() |
GSK Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
GskPacketQueueClass; GskPacketQueue; gboolean gsk_packet_queue_bind (GskPacketQueue *queue, GskSocketAddress *address, GError **error); GskPacket * gsk_packet_queue_read (GskPacketQueue *queue, gboolean save_address, GError **error); gboolean gsk_packet_queue_write (GskPacketQueue *queue, GskPacket *out, GError **error); #define gsk_packet_queue_get_allow_address (queue) #define gsk_packet_queue_get_allow_no_address(queue) #define gsk_packet_queue_get_misses_packets (queue) #define gsk_packet_queue_get_is_readable (queue) #define gsk_packet_queue_get_is_writable (queue) #define gsk_packet_queue_peek_bound_address (queue) #define gsk_packet_queue_mark_allow_address (queue) #define gsk_packet_queue_mark_allow_no_address(queue) #define gsk_packet_queue_mark_misses_packets(queue) #define gsk_packet_queue_mark_is_readable (queue) #define gsk_packet_queue_mark_is_writable (queue) #define gsk_packet_queue_clear_allow_address(queue) #define gsk_packet_queue_clear_allow_no_address(queue) #define gsk_packet_queue_clear_misses_packets(queue) #define gsk_packet_queue_clear_is_readable (queue) #define gsk_packet_queue_clear_is_writable (queue) void gsk_packet_queue_set_bound_addresss (GskPacketQueue *queue, GskSocketAddress *address);
Datagram I/O means binary packets of data are the transmission unit. You can bind to an address in the right family, and read and write packets. Unless the packet_queue is bound, it is unlikely to ever be readable.
typedef struct { GskIOClass io_class; gboolean (*bind) (GskPacketQueue *queue, GskSocketAddress *addr, GError **error); GskPacket *(*read) (GskPacketQueue *queue, gboolean save_address, GError **error); gboolean (*write) (GskPacketQueue *queue, GskPacket *out, GError **error); } GskPacketQueueClass;
Base class for an object which can input and output packets.
GskIOClass |
parent class. |
|
bind to a particular socket-address. |
|
read an incoming packet. |
|
write an outgoing packet. |
typedef struct _GskPacketQueue GskPacketQueue;
Abstract instance which can read and write packets.
gboolean gsk_packet_queue_bind (GskPacketQueue *queue, GskSocketAddress *address, GError **error);
Bind a packet queue to receive on a particular address.
|
the packet queue to bind to a particular address. |
|
the address to receive packets from. |
|
optional error return value. |
Returns : |
whether the bind call succeeded. |
GskPacket * gsk_packet_queue_read (GskPacketQueue *queue, gboolean save_address, GError **error);
Read a packet from the queue, optionally tracking whence it came.
|
to try to read a packet from |
|
whether to create a remote address indication. |
|
optional error return value. |
Returns : |
a new packet, or NULL on error or if no packet was available. |
gboolean gsk_packet_queue_write (GskPacketQueue *queue, GskPacket *out, GError **error);
Try and write a packet to the queue. If the packet has no address, then the packet-queue must allow_no_address. If the packet has an address, then the packet-queue must allow_address.
|
to try to write a packet to |
|
outgoing packet. |
|
optional error return value. |
Returns : |
whether the write succeeded. |
#define gsk_packet_queue_get_allow_address(queue)
Determine whether packets with remote addresses may be written to this packet queue.
|
the packet-queue to query. |
#define gsk_packet_queue_get_allow_no_address(queue)
Determine whether packets without a remote address may be written to this packet queue.
|
the packet-queue to query. |
#define gsk_packet_queue_get_misses_packets(queue)
Determine whether the packet-queue drops incoming packets.
|
the packet-queue to query. |
#define gsk_packet_queue_get_is_readable(queue)
Determine whether the packet-queue may have incoming packets.
|
the packet-queue to query. |
#define gsk_packet_queue_get_is_writable(queue)
Determine whether the packet-queue may have packets written to it.
|
the packet-queue to query. |
#define gsk_packet_queue_peek_bound_address(queue)
Get the address this queue is bound to, or NULL.
|
the packet-queue to query. |
#define gsk_packet_queue_mark_allow_address(queue)
Indicate that this packet-queue can accept outgoing packets which have an address.
This should only be used by derived classes.
|
the packet-queue to affect. |
#define gsk_packet_queue_mark_allow_no_address(queue)
Indicate that this packet-queue can accept outgoing packets which have an no address.
This should only be used by derived classes.
|
the packet-queue to affect. |
#define gsk_packet_queue_mark_misses_packets(queue)
Indicate that this packet-queue may drop incoming packets.
This should only be used by derived classes.
|
the packet-queue to affect. |
#define gsk_packet_queue_mark_is_readable(queue)
Indicate that this packet-queue may be read from.
This should only be used by derived classes.
|
the packet-queue to affect. |
#define gsk_packet_queue_mark_is_writable(queue)
Indicate that this packet-queue may be written to.
This should only be used by derived classes.
|
the packet-queue to affect. |
#define gsk_packet_queue_clear_allow_address(queue)
Indicate that this packet-queue cannot accept outgoing packets which have an address.
This should only be used by derived classes.
|
the packet-queue to affect. |
#define gsk_packet_queue_clear_allow_no_address(queue)
Indicate that this packet-queue cannot accept outgoing packets which have no address.
This should only be used by derived classes.
|
the packet-queue to affect. |
#define gsk_packet_queue_clear_misses_packets(queue)
Indicate that this packet-queue will not drop incoming packets.
This should only be used by derived classes.
|
the packet-queue to affect. |
#define gsk_packet_queue_clear_is_readable(queue)
Indicate that this packet-queue may not be read from.
This should only be used by derived classes.
|
the packet-queue to affect. |
#define gsk_packet_queue_clear_is_writable(queue)
Indicate that this packet-queue may not be written to.
This should only be used by derived classes.
|
the packet-queue to affect. |
void gsk_packet_queue_set_bound_addresss (GskPacketQueue *queue, GskSocketAddress *address);
Set the bound_address member of the packet-queue safely.
This should only be called by implementations which automatically bind to certain addresses.
|
queue to mark |
|
address to which the queue has been bound. |