-
public void connect_async (Cancellable? cancellable, SocketCallback callback)
Begins asynchronously connecting to sock's remote address. The socket will call
callback when it succeeds or fails (but not before returning from this function).
-
public uint connect_sync (Cancellable? cancellable)
Attempt to synchronously connect sock to its remote address.
-
public void disconnect ()
Disconnects sock. Any further read or write attempts on it will fail.
-
public int get_fd ()
-
public weak Address get_local_address ()
Returns the Address corresponding to the local end of
sock.
-
public weak Address get_remote_address ()
Returns the Address corresponding to the remote end of
sock.
-
public bool is_connected ()
Tests if sock is connected to another host
-
public bool is_ssl ()
Tests if sock is set up to do SSL. Note that this simply means that the
SOCKET_SSL_CREDENTIALS property has been set; it does not mean that
start_ssl has been called.
-
public bool listen ()
Makes sock start listening on its local address. When connections come in, sock
will emit new_connection.
-
public SocketIOStatus read (uint8[] buffer, out size_t nread, Cancellable? cancellable) throws Error
Attempts to read up to len bytes from sock into buffer. If some
data is successfully read, read will return
OK, and *@nread will contain the number of bytes actually read (which may
be less than len).
-
public SocketIOStatus read_until (uint8[] buffer, void* boundary, size_t boundary_len, out size_t nread, bool got_boundary, Cancellable? cancellable) throws Error
Like read, but reads no further than the first
occurrence of boundary. (If the boundary is found, it will be included in the returned data, and *@got_boundary will be
set to true.) Any data after the boundary will returned in future reads.
-
public bool start_proxy_ssl (string ssl_host, Cancellable? cancellable)
Starts using SSL on socket, expecting to find a host named ssl_host.
-
public bool start_ssl (Cancellable? cancellable)
Starts using SSL on socket.
-
public SocketIOStatus write (uint8[] buffer, out size_t nwrote, Cancellable? cancellable) throws Error
Attempts to write len bytes from buffer to sock. If some data is
successfully written, the return status will be OK, and *@nwrote will
contain the number of bytes actually written (which may be less than len).