Socket.sendMessageWithTimeout

gio.types.PollableReturn sendMessageWithTimeout(gio.socket_address.SocketAddress address, gio.types.OutputVector[] vectors, gio.socket_control_message.SocketControlMessage[] messages, int flags, long timeoutUs, out size_t bytesWritten, gio.cancellable.Cancellable cancellable = null)

This behaves exactly the same as [gio.socket.Socket.sendMessage], except that the choice of timeout behavior is determined by the timeout_us argument rather than by socket's properties.

On error [gio.types.PollableReturn.Failed] is returned and error is set accordingly, or if the socket is currently not writable [gio.types.PollableReturn.WouldBlock] is returned. bytes_written will contain 0 in both cases.

Parameters

addressa #GSocketAddress, or null
vectorsan array of #GOutputVector structs
messagesa pointer to an array of #GSocketControlMessages, or null.
flagsan int containing #GSocketMsgFlags flags, which may additionally contain other platform specific flags
timeoutUsthe maximum time (in microseconds) to wait, or -1
bytesWrittenlocation to store the number of bytes that were written to the socket
cancellablea [gio.cancellable.Cancellable] or null

Returns

[gio.types.PollableReturn.Ok] if all data was successfully written,

[gio.types.PollableReturn.WouldBlock] if the socket is currently not writable, or [gio.types.PollableReturn.Failed] if an error happened and error is set.

Throws

[ErrorWrap]