Socket.sendMessageWithTimeout

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

On error G_POLLABLE_RETURN_FAILED is returned and error is set accordingly, or if the socket is currently not writable G_POLLABLE_RETURN_WOULD_BLOCK is returned. bytes_written will contain 0 in both cases.

Parameters

address SocketAddress
vectors GOutputVector[]

an array of GOutputVector structs

messages SocketControlMessage[]

a pointer to an array of gio.SocketControlMessages, or NULL.

flags int

an int containing GSocketMsgFlags flags, which may additionally contain other platform specific flags

timeoutUs long

the maximum time (in microseconds) to wait, or -1

bytesWritten size_t

location to store the number of bytes that were written to the socket

cancellable Cancellable

a GCancellable or NULL

Return Value

G_POLLABLE_RETURN_OK if all data was successfully written, G_POLLABLE_RETURN_WOULD_BLOCK if the socket is currently not writable, or G_POLLABLE_RETURN_FAILED if an error happened and error is set.

Throws

GException on failure.

Meta

Since

2.60