![]() | ![]() | ![]() | GNetwork Library Manual | ![]() |
---|
GNetworkTcpConnection — A TCP/IP connection object.
enum GNetworkTcpConnectionStatus; struct GNetworkTcpConnection; struct GNetworkTcpConnectionClass;
"address" gchararray : Read / Write "authentication-type" GNetworkSslAuthType : Read / Write "authority-file" gchararray : Read / Write "certificate-file" gchararray : Read / Write "ip-address" GNetworkIpAddress : Read "key-file" gchararray : Read / Write "local-address" GNetworkIpAddress : Read "local-port" guint : Read "port" guint : Read / Write "proxy-type" GNetworkTcpProxyType : Read / Write "socket" gpointer : Read / Write "ssl-enabled" gboolean : Read / Write "tcp-status" GNetworkTcpConnectionStatus : Read
"certificate-error" void user_function (GNetworkTcpConnection *gnetworktcpconnection, GNetworkSslCert *arg1, GNetworkSslCertErrorFlags arg2, gpointer user_data);
The GNetworkTcpConnection object and associated functions provide the easiest way to create a TCP/IP networking connection. Simply start the Glib main loop, create a new object, connect to the signals, and open it. Properties of this object and the GNetworkConnection interface can be set via g_object_set().
The "error" signal for GnetworkTcpConnection objects use the following error domains: GNETWORK_CONNECTION_ERROR, GNETWORK_SSL_ERROR, GNETWORK_SSL_CERT_ERROR, G_IO_CHANNEL_ERROR, GNETWORK_TCP_PROXY_ERROR.
typedef enum /* <prefix=GNETWORK_TCP_CONNECTION_STATUS> */ { GNETWORK_TCP_CONNECTION_CLOSING, GNETWORK_TCP_CONNECTION_CLOSED, GNETWORK_TCP_CONNECTION_LOOKUP, GNETWORK_TCP_CONNECTION_OPENING, GNETWORK_TCP_CONNECTION_PROXYING, GNETWORK_TCP_CONNECTION_AUTHENTICATING, GNETWORK_TCP_CONNECTION_OPEN } GNetworkTcpConnectionStatus;
An enumeration of the possible states a GNetworkTcpConnection can be in.
GNETWORK_TCP_CONNECTION_CLOSING | the object is closing. |
GNETWORK_TCP_CONNECTION_CLOSED | the object is closed. |
GNETWORK_TCP_CONNECTION_LOOKUP | the object is waiting for a DNS return. |
GNETWORK_TCP_CONNECTION_OPENING | the object is opening the connection from this computer. |
GNETWORK_TCP_CONNECTION_PROXYING | the object is attempting to access the proxy server. |
GNETWORK_TCP_CONNECTION_AUTHENTICATING | the object is authenticating with the SSL server. |
GNETWORK_TCP_CONNECTION_OPEN | the object is open and ready to receive data. |
struct GNetworkTcpConnectionClass { void (*certificate_error) (GNetworkTcpConnection * connection, GNetworkSslCert * certificate, GNetworkSslCertErrorFlags errors); };
The class structure for GNetworkTcpConnection objects.
void (*certificate_error) (GNetworkTcpConnection * connection, GNetworkSslCert * certificate, GNetworkSslCertErrorFlags errors) | the object callback stub for the "certificate-error" signal. |
"address" gchararray : Read / Write
The hostname or IP address to connect to.
Default value: NULL
"authentication-type" GNetworkSslAuthType : Read / Write
What type of SSL authentication should be performed with this connection.
Default value: GNETWORK_SSL_AUTH_ANONYMOUS
"authority-file" gchararray : Read / Write
The path to a file which contains the X.509 certificates of trusted signers.
Default value: NULL
"certificate-file" gchararray : Read / Write
The path to a file which contains X.509 certificates to distribute to clients.
Default value: NULL
"key-file" gchararray : Read / Write
The path to a file which contains X.509 keys to distribute to clients.
Default value: NULL
"local-address" GNetworkIpAddress : Read
The IP address of this computer.
"local-port" guint : Read
The local port number we are connected through.
Allowed values: <= 65535
Default value: 0
"port" guint : Read / Write
The port number to connect to.
Allowed values: <= 65535
Default value: 0
"proxy-type" GNetworkTcpProxyType : Read / Write
The type of proxy to use, depending on the protocol.
Default value: GNETWORK_TCP_PROXY_HTTP
"ssl-enabled" gboolean : Read / Write
Whether or not SSL will be used with this connection.
Default value: FALSE
"tcp-status" GNetworkTcpConnectionStatus : Read
The current status of the TCP/IP connection.
Default value: GNETWORK_TCP_CONNECTION_CLOSED
void user_function (GNetworkTcpConnection *gnetworktcpconnection, GNetworkSslCert *arg1, GNetworkSslCertErrorFlags arg2, gpointer user_data);
This signal is emitted when an SSL-enabled connection encounters an error while attempting to verify the certificate in arg1.
gnetworktcpconnection : | the object which received the signal. |
arg1 : | the certificate which has problems. |
arg2 : | a bitmask of the problems with arg1. |
user_data : | user data set when the signal handler was connected. |
<< GNetworkConnection | GNetworkUnixConnection >> |