Gio.Socket.prototype.receive_from

function receive_from(buffer: ByteArray, cancellable: Gio.Cancellable): [return_value: Number(gssize), address: Gio.SocketAddress] {
    // Gjs wrapper for g_socket_receive_from()
}
  

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.prototype.receive for additional information.

Since 2.22

buffer

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

cancellable

a %GCancellable or null

return_value

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

address

a pointer to a Gio.SocketAddress pointer, or null