Class: Gio::SocketConnection
Direct Known Subclasses
Class Method Summary collapse
-
.factory_lookup_type(family, type, protocol_id) ⇒ GLib::Type
Looks up the #GType to be used when creating socket connections on sockets with the specified family, type and protocol_id.
-
.factory_register_type(g_type, family, type, protocol) ⇒ nil
Looks up the #GType to be used when creating socket connections on sockets with the specified family, type and protocol.
Instance Method Summary collapse
-
#connect(address, cancellable) ⇒ Boolean
Connect connection to the specified remote address.
-
#connect_async(address, cancellable, callback, user_data) ⇒ nil
Asynchronously connect connection to the specified remote address.
-
#connect_finish(result) ⇒ Boolean
Gets the result of a g_socket_connection_connect_async() call.
-
#is_connected ⇒ Boolean
Checks if connection is connected.
-
#local_address ⇒ Gio::SocketAddress
Try to get the local address of a socket connection.
-
#remote_address ⇒ Gio::SocketAddress
Try to get the remote address of a socket connection.
-
#socket ⇒ Gio::Socket
The underlying [classGio.Socket].
-
#socket=(socket) ⇒ Gio::Socket
The underlying [classGio.Socket].
Methods inherited from IOStream
#clear_pending, #close, #close_async, #close_finish, #closed=, #closed?, #has_pending, #input_stream, #input_stream=, #is_closed, #output_stream, #output_stream=, #set_pending, #splice_async, splice_finish
Class Method Details
.factory_lookup_type(family, type, protocol_id) ⇒ GLib::Type
Looks up the #GType to be used when creating socket connections on sockets with the specified family, type and protocol_id.
If no type is registered, the GSocket::Connection base type is returned.
.factory_register_type(g_type, family, type, protocol) ⇒ nil
Looks up the #GType to be used when creating socket connections on sockets with the specified family, type and protocol.
If no type is registered, the GSocket::Connection base type is returned.
Instance Method Details
#connect(address, cancellable) ⇒ Boolean
Connect connection to the specified remote address.
#connect_async(address, cancellable, callback, user_data) ⇒ nil
Asynchronously connect connection to the specified remote address.
This clears the #GSocket:blocking flag on connection's underlying socket if it is currently set.
If #GSocket:timeout is set, the operation will time out and return %G_IO_ERROR_TIMED_OUT after that period. Otherwise, it will continue indefinitely until operating system timeouts (if any) are hit.
Use g_socket_connection_connect_finish() to retrieve the result.
#connect_finish(result) ⇒ Boolean
Gets the result of a g_socket_connection_connect_async() call.
#is_connected ⇒ Boolean
Checks if connection is connected. This is equivalent to calling g_socket_is_connected() on connection's underlying #GSocket.
#local_address ⇒ Gio::SocketAddress
Try to get the local address of a socket connection.
#remote_address ⇒ Gio::SocketAddress
Try to get the remote address of a socket connection.
Since GLib 2.40, when used with g_socket_client_connect() or g_socket_client_connect_async(), during emission of %G_SOCKET_CLIENT_CONNECTING, this function will return the remote address that will be used for the connection. This allows applications to print e.g. "Connecting to example.com (10.42.77.3)...".
#socket ⇒ Gio::Socket
The underlying [classGio.Socket].
#socket=(socket) ⇒ Gio::Socket
The underlying [classGio.Socket].