Socket
Object Hierarchy:
Description:
[ CCode ( type_id = "soup_socket_get_type ()" ) ]
public class Socket : Object, Initable
Content:
Properties:
Creation methods:
Methods:
- public void connect_async (Cancellable? cancellable, SocketCallback callback)
Begins asynchronously connecting to this
's remote address.
- public uint connect_sync (Cancellable? cancellable = null)
Attempt to synchronously connect this
to its remote address.
- public void disconnect ()
Disconnects this.
- public int get_fd ()
Gets this's underlying file
descriptor.
- public unowned Address get_local_address ()
Returns the Address
corresponding to the local end of this.
- public unowned Address get_remote_address ()
Returns the Address
corresponding to the remote end of this.
- public bool is_connected ()
Tests if this is connected to
another host
- public bool is_ssl ()
Tests if this is doing (or has
attempted to do) SSL.
- public bool listen ()
Makes this start listening on its
local address.
- public SocketIOStatus read (uint8[] buffer, out size_t nread, Cancellable? cancellable = null) throws Error
Attempts to read up to buffer.length
bytes from
this into buffer
.
- public SocketIOStatus read_until (uint8[] buffer, void* boundary, size_t boundary_len, out size_t nread, out bool got_boundary, Cancellable? cancellable = null) throws Error
Like read, but
reads no further than the first occurrence of boundary
.
- public bool start_proxy_ssl (string ssl_host, Cancellable? cancellable = null)
Starts using SSL on socket
, expecting to find a host
named ssl_host
.
- public bool start_ssl (Cancellable? cancellable = null)
Starts using SSL on socket
.
- public SocketIOStatus write (uint8[] buffer, out size_t nwrote, Cancellable? cancellable = null) throws Error
Attempts to write buffer.length
bytes from buffer
to this.
Signals:
- public virtual signal void disconnected ()
Emitted when the socket is disconnected, for whatever reason.
- public signal void event (SocketClientEvent event, IOStream connection)
Emitted when a network-related event occurs.
- public virtual signal void new_connection (Socket new_sock)
Emitted when a listening socket (set up with
listen) receives a new connection.
- public virtual signal void readable ()
Emitted when an async socket is readable.
- public virtual signal void writable ()
Emitted when an async socket is writable.
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface GLib.Initable