TcpConnection

This is the subclass of GSocketConnection that is created for TCP/IP sockets.

Constructors

this
this(GTcpConnection* gTcpConnection)

Sets our main struct and passes it to the parent class

Members

Functions

getGracefulDisconnect
int getGracefulDisconnect()

Checks if graceful disconnects are used. See g_tcp_connection_set_graceful_disconnect(). Since 2.22

getStruct
void* getStruct()

the main Gtk struct as a void*

getTcpConnectionStruct
GTcpConnection* getTcpConnectionStruct()

Get the main Gtk struct

setGracefulDisconnect
void setGracefulDisconnect(int gracefulDisconnect)

This enabled graceful disconnects on close. A graceful disconnect means that we signal the receiving end that the connection is terminated and wait for it to close the connection before closing the connection. A graceful disconnect means that we can be sure that we successfully sent all the outstanding data to the other end, or get an error reported. However, it also means we have to wait for all the data to reach the other side and for it to acknowledge this by closing the socket, which may take a while. For this reason it is disabled by default. Since 2.22

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

gTcpConnection
GTcpConnection* gTcpConnection;

the main Gtk struct

Inherited Members

From SocketConnection

gSocketConnection
GSocketConnection* gSocketConnection;

the main Gtk struct

getSocketConnectionStruct
GSocketConnection* getSocketConnectionStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
connect
int connect(SocketAddress address, Cancellable cancellable)

Connect connection to the specified remote address. Since 2.32

connectAsync
void connectAsync(SocketAddress address, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

Asynchronously connect connection to the specified remote address. This clears the "blocking" flag on connection's underlying socket if it is currently set. Use g_socket_connection_connect_finish() to retrieve the result. Since 2.32

connectFinish
int connectFinish(AsyncResultIF result)

Gets the result of a g_socket_connection_connect_async() call. Since 2.32

isConnected
int isConnected()

Checks if connection is connected. This is equivalent to calling g_socket_is_connected() on connection's underlying GSocket. Since 2.32

getLocalAddress
SocketAddress getLocalAddress()

Try to get the local address of a socket connection. Since 2.22

getRemoteAddress
SocketAddress getRemoteAddress()

Try to get the remote address of a socket connection. Since 2.22

getSocket
Socket getSocket()

Gets the underlying GSocket object of the connection. This can be useful if you want to do something unusual on it not supported by the GSocketConnection APIs. Since 2.22

factoryCreateConnection
SocketConnection factoryCreateConnection(Socket socket)

Creates a GSocketConnection subclass of the right type for socket. Since 2.22

factoryLookupType
GType factoryLookupType(GSocketFamily family, GSocketType type, int protocolId)

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 GSocketConnection base type is returned. Since 2.22

factoryRegisterType
void factoryRegisterType(GType gType, GSocketFamily family, GSocketType type, int protocol)

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 GSocketConnection base type is returned. Since 2.22

Meta