Socket.sendMessageWithTimeout

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

address gio.socket_address.SocketAddress

a #GSocketAddress, or null

vectors gio.types.OutputVector[]

an array of #GOutputVector structs

messages gio.socket_control_message.SocketControlMessage[]

a pointer to an array of #GSocketControlMessages, 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 gio.cancellable.Cancellable

Return Value

Type: gio.types.PollableReturn

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.