A socket connection : IOStream, SocketClient, SocketListener. More...
Inherits Gio::IOStream.
Inherited by Gio::TcpConnection, and Gio::UnixConnection.
Public Member Functions | |
virtual | ~SocketConnection () |
GSocketConnection* | gobj () |
Provides access to the underlying C GObject. | |
const GSocketConnection* | gobj () const |
Provides access to the underlying C GObject. | |
GSocketConnection* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::RefPtr< Socket > | get_socket () |
Gets the underlying Socket object of the connection. | |
Glib::RefPtr< const Socket > | get_socket () const |
Gets the underlying Socket object of the connection. | |
Glib::RefPtr< SocketAddress > | get_local_address () |
Try to get the local address of a socket connection. | |
Glib::RefPtr< const SocketAddress > | get_local_address () const |
Try to get the local address of a socket connection. | |
Glib::RefPtr< SocketAddress > | get_remote_address () |
Try to get the remote address of a socket connection. | |
Glib::RefPtr< const SocketAddress > | get_remote_address () const |
Try to get the remote address of a socket connection. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< Socket > > | property_socket () const |
The underlying GSocket. | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr < Gio::SocketConnection > | wrap (GSocketConnection* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
A socket connection : IOStream, SocketClient, SocketListener.
SocketConnection is a IOStream for a connected socket. They can be created either by SocketClient when connecting to a host, or by SocketListener when accepting a new client.
The type of the SocketConnection object returned from these calls depends on the type of the underlying socket that is in use. For instance, for a TCP/IP connection it will be a TcpConnection.
Chosing what type of object to construct is done with the socket connection factory, and it is possible for 3rd parties to register custom socket connection types for specific combination of socket family/type/protocol using g_socket_connection_factory_register_type().
virtual Gio::SocketConnection::~SocketConnection | ( | ) | [virtual] |
Glib::RefPtr<const SocketAddress> Gio::SocketConnection::get_local_address | ( | ) | const |
Try to get the local address of a socket connection.
0
on error. Free the returned object with Glib::object_unref().Glib::RefPtr<SocketAddress> Gio::SocketConnection::get_local_address | ( | ) |
Try to get the local address of a socket connection.
0
on error. Free the returned object with Glib::object_unref().Glib::RefPtr<const SocketAddress> Gio::SocketConnection::get_remote_address | ( | ) | const |
Try to get the remote address of a socket connection.
0
on error. Free the returned object with Glib::object_unref().Glib::RefPtr<SocketAddress> Gio::SocketConnection::get_remote_address | ( | ) |
Try to get the remote address of a socket connection.
0
on error. Free the returned object with Glib::object_unref().Glib::RefPtr<const Socket> Gio::SocketConnection::get_socket | ( | ) | const |
Gets the underlying Socket object of the connection.
This can be useful if you want to do something unusual on it not supported by the SocketConnection APIs.
0
on error.Glib::RefPtr<Socket> Gio::SocketConnection::get_socket | ( | ) |
Gets the underlying Socket object of the connection.
This can be useful if you want to do something unusual on it not supported by the SocketConnection APIs.
0
on error.const GSocketConnection* Gio::SocketConnection::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gio::IOStream.
Reimplemented in Gio::TcpConnection, and Gio::UnixConnection.
GSocketConnection* Gio::SocketConnection::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gio::IOStream.
Reimplemented in Gio::TcpConnection, and Gio::UnixConnection.
GSocketConnection* Gio::SocketConnection::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Reimplemented from Gio::IOStream.
Reimplemented in Gio::TcpConnection, and Gio::UnixConnection.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Socket> > Gio::SocketConnection::property_socket | ( | ) | const |
The underlying GSocket.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::RefPtr< Gio::SocketConnection > wrap | ( | GSocketConnection * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |