Socket.receiveWithBlocking

This behaves exactly the same as g_socket_receive(), except that the choice of blocking or non-blocking behavior is determined by the blocking argument rather than by socket's properties. Since 2.26

class Socket
receiveWithBlocking

Parameters

buffer string

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

size gsize

the number of bytes you want to read from the socket

blocking int

whether to do blocking or non-blocking I/O

cancellable Cancellable

a GCancellable or NULL. [allow-none]

Return Value

Type: gssize

Number of bytes read, or -1 on error

Throws

GException on failure.

Meta