gio.types.PollableReturn.WouldBlock if the socket is currently not writable, or gio.types.PollableReturn.Failed if an error happened and error is set.
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
address | a #GSocketAddress, or null |
vectors | an array of #GOutputVector structs |
messages | a pointer to an array of #GSocketControlMessages, or null. |
flags | an int containing #GSocketMsgFlags flags, which may additionally contain other platform specific flags |
timeoutUs | the maximum time (in microseconds) to wait, or -1 |
bytesWritten | location to store the number of bytes that were written to the socket |
cancellable | a gio.cancellable.Cancellable or null |
Returns
gio.types.PollableReturn.Ok if all data was successfully written,