Socket.write

Attempts to write @len bytes from @buffer to @sock. If some data is successfully written, the return status will be %SOUP_SOCKET_OK, and *@nwrote will contain the number of bytes actually written (which may be less than @len).

If @sock is non-blocking, and no data could be written right away, the return value will be %SOUP_SOCKET_WOULD_BLOCK. In this case, the caller can connect to the #SoupSocket::writable signal to know when more data can be written. (NB: #SoupSocket::writable is only emitted after soup_socket_write() returns %SOUP_SOCKET_WOULD_BLOCK, and it is only emitted once. See the documentation for #SoupSocket:non-blocking.)

class Socket
write
(
ubyte[] buffer
,
out size_t nwrote
,
Cancellable cancellable
)

Parameters

buffer ubyte[]

data to write

nwrote size_t

on return, number of bytes written

cancellable Cancellable

a #GCancellable, or %NULL

Return Value

a #SoupSocketIOStatus, as described above (or %SOUP_SOCKET_EOF or %SOUP_SOCKET_ERROR. @error will be set if the return value is %SOUP_SOCKET_ERROR.)

Throws

GException on failure.

Meta