Socket
Object Hierarchy:
Description:
Namespace: Soup
Package: libsoup-2.4
Content:
Properties:
- public MainContext async_context { owned get; construct; }
- public int fd { get; construct; }
- public Socket gsocket { construct; }
- public IOStream iostream { construct; }
- public bool ipv6_only { get; set; }
- public bool is_server { get; }
Whether or not the socket is a server socket.
- public Address local_address { get; construct; }
- public bool non_blocking { get; set; }
Whether or not the socket uses non-blocking I/O.
- public Address remote_address { get; construct; }
- public void* ssl_creds { get; set; }
- public bool ssl_fallback { get; construct; }
- public bool ssl_strict { get; construct; }
- public uint timeout { get; set; }
- public TlsCertificate tls_certificate { owned get; }
- public TlsCertificateFlags tls_errors { get; }
- public bool trusted_certificate { get; }
- public bool use_thread_context { get; construct; }
Use get_thread_default.
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 intobuffer
. - 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 namedssl_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 frombuffer
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
All known members inherited from interface GLib.Initable