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 gio.socket.Socket.receive for additional information.

class Socket
ptrdiff_t
receiveFrom

Parameters

address gio.socket_address.SocketAddress

a pointer to a #GSocketAddress pointer, or null

buffer ubyte[]

a buffer to read data into (which should be at least size bytes long).

cancellable gio.cancellable.Cancellable

Return Value

Type: ptrdiff_t

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