Socket.receiveFrom

Receive data (up to size bytes) from a socket. If address is non-NULL then address will be set equal to the source address of the received packet. address is owned by the caller. See g_socket_receive() for additional information. Since 2.22

class Socket
receiveFrom

Parameters

address SocketAddress

a pointer to a GSocketAddress pointer, or NULL. out[allow-none]

buffer char[]

a buffer to read data into (which should be at least size bytes long). [array length=size][element-type guint8]

cancellable Cancellable

a GCancellable or NULL. [allow-none]

Return Value

Type: gssize

Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error

Throws

GException on failure.

Meta