glibmm: Portable Network I/O Functionality

Classes

class  Gio::InetAddress
 An IPv4/IPv6 address. More...

 
class  Gio::InetSocketAddress
 Internet SocketAddress. More...

 
class  Gio::NetworkAddress
 A SocketConnectable for resolving hostnames. More...

 
class  Gio::NetworkService
 A GSocketConnectable for resolving SRV records. More...

 
class  Gio::Proxy
 Proxy - Interface for proxy handling. More...

 
class  Gio::ProxyAddress
 ProxyAddress - An internet address with proxy information. More...

 
class  Gio::ProxyResolver
 ProxyResolver - Asynchronous and cancellable network proxy resolver. More...

 
class  Gio::Resolver
 Asynchronous and cancellable DNS resolver. More...

 
class  Gio::Socket
 Low-level socket object. More...

 
class  Gio::SocketAddress
 Abstract base class representing endpoints for socket communication. More...

 
class  Gio::SocketAddressEnumerator
 Enumerator type for objects that contain or generate SocketAddresses. More...

 
class  Gio::SocketClient
 Helper for connecting to a network service. More...

 
class  Gio::SocketConnectable
 Interface for potential socket endpoints. More...

 
class  Gio::SocketConnection
 A socket connection. More...

 
class  Gio::SocketControlMessage
 SocketControlMessage - A Socket control message. More...

 
class  Gio::SocketListener
 Helper for accepting network client connections. More...

 
class  Gio::SocketService
 Make it easy to implement a network service. More...

 
class  Gio::SrvTarget
 DNS SRV record target. More...

 
class  Gio::TcpConnection
 A TCP SocketConnection. More...

 
class  Gio::TcpWrapperConnection
 Wrapper for non-Gio::SocketConnection-based, Gio::Socket-based Gio::IOStreams. More...

 
class  Gio::ThreadedSocketService
 A threaded GSocketService. More...

 
class  Gio::UnixConnection
 A Unix domain SocketConnection. More...

 
class  Gio::UnixCredentialsMessage
 UnixCredentialsMessage - A SocketControlMessage containing credentials. More...

 
class  Gio::UnixFDList
 UnixFDList - An object containing a set of UNIX file descriptors. More...

 
class  Gio::UnixFDMessage
 UnixFDMessage — A GSocketControlMessage containing a GUnixFDList. More...

 
class  Gio::UnixSocketAddress
 UnixSocketAddress - UNIX SocketAddress. More...

 
class  Gio::SignalSocket
 
class  Gio::SocketSource
 An event source that can monitor a Gio::Socket. More...

 

Enumerations

enum  Gio::Resolver::RecordType {

  Gio::Resolver::RecordType::SRV = 1,

  Gio::Resolver::RecordType::MX,

  Gio::Resolver::RecordType::TXT,

  Gio::Resolver::RecordType::SOA,

  Gio::Resolver::RecordType::NS

}
 The type of record that g_resolver_lookup_records() or g_resolver_lookup_records_async() should retrieve. More...

 
enum  Gio::Socket::Type {

  Gio::Socket::Type::INVALID,

  Gio::Socket::Type::STREAM,

  Gio::Socket::Type::DATAGRAM,

  Gio::Socket::Type::SEQPACKET

}
 Flags used when creating a Socket. More...

 
enum  Gio::Socket::Protocol {

  Gio::Socket::Protocol::UNKNOWN = -1,

  Gio::Socket::Protocol::DEFAULT = 0,

  Gio::Socket::Protocol::TCP = 6,

  Gio::Socket::Protocol::UDP = 17,

  Gio::Socket::Protocol::SCTP = 132

}
 A protocol identifier is specified when creating a Socket, which is a family/type specific identifier, where 0 means the default protocol for the particular family/type. More...

 
enum  Gio::Socket::MsgFlags {

  Gio::Socket::MsgFlags::NONE = 0x0,

  Gio::Socket::MsgFlags::OOB = GLIB_SYSDEF_MSG_OOB,

  Gio::Socket::MsgFlags::PEEK = GLIB_SYSDEF_MSG_PEEK,

  Gio::Socket::MsgFlags::DONTROUTE = GLIB_SYSDEF_MSG_DONTROUTE

}
 Flags used in g_socket_receive_message() and g_socket_send_message(). More...

 
enum  Gio::UnixSocketAddress::Type {

  Gio::UnixSocketAddress::Type::INVALID,

  Gio::UnixSocketAddress::Type::ANONYMOUS,

  Gio::UnixSocketAddress::Type::PATH,

  Gio::UnixSocketAddress::Type::ABSTRACT,

  Gio::UnixSocketAddress::Type::ABSTRACT_PADDED

}
 The type of name used by a UnixSocketAddress. More...

 

Functions

SignalSocket Gio::signal_socket (const Glib::RefPtr< Glib::MainContext >& context=Glib::RefPtr< Glib::MainContext >())
 Convenience socket signal. More...

 

Detailed Description

Enumeration Type Documentation

enum Gio::Socket::MsgFlags
strong

Flags used in g_socket_receive_message() and g_socket_send_message().

The flags listed in the enum are some commonly available flags, but the values used for them are the same as on the platform, and any other flags are passed in/out as is. So to use a platform specific flag, just include the right system header and pass in the flag.

Since glibmm 2.22:
Bitwise operators:
Socket::MsgFlags operator|(Socket::MsgFlags, Socket::MsgFlags)

Socket::MsgFlags operator&(Socket::MsgFlags, Socket::MsgFlags)

Socket::MsgFlags operator^(Socket::MsgFlags, Socket::MsgFlags)

Socket::MsgFlags operator~(Socket::MsgFlags)

Socket::MsgFlags& operator|=(Socket::MsgFlags&, Socket::MsgFlags)

Socket::MsgFlags& operator&=(Socket::MsgFlags&, Socket::MsgFlags)

Socket::MsgFlags& operator^=(Socket::MsgFlags&, Socket::MsgFlags)

Enumerator
NONE 

No flags.

OOB 

Request to send/receive out of band data.

PEEK 

Read data from the socket without removing it from the queue.

DONTROUTE 

Don't use a gateway to send out the packet, only send to hosts on directly connected networks.

enum Gio::Socket::Protocol
strong

A protocol identifier is specified when creating a Socket, which is a family/type specific identifier, where 0 means the default protocol for the particular family/type.

This enum contains a set of commonly available and used protocols. You can also pass any other identifiers handled by the platform in order to use protocols not listed here.

Since glibmm 2.22:
Enumerator
UNKNOWN 

The protocol type is unknown.

DEFAULT 

The default protocol for the family/type.

TCP 

TCP over IP.

UDP 

UDP over IP.

SCTP 

SCTP over IP.

The type of record that g_resolver_lookup_records() or g_resolver_lookup_records_async() should retrieve.

The records are returned as lists of Variant tuples. Each record type has different values in the variant tuples returned.

Gio::ResolverRecordType::SRV records are returned as variants with the signature '(qqqs)', containing a guint16 with the priority, a guint16 with the weight, a guint16 with the port, and a string of the hostname.

Gio::ResolverRecordType::MX records are returned as variants with the signature '(qs)', representing a guint16 with the preference, and a string containing the mail exchanger hostname.

Gio::ResolverRecordType::TXT records are returned as variants with the signature '(as)', representing an array of the strings in the text record.

Gio::ResolverRecordType::SOA records are returned as variants with the signature '(ssuuuuu)', representing a string containing the primary name server, a string containing the administrator, the serial as a guint32, the refresh interval as guint32, the retry interval as a guint32, the expire timeout as a guint32, and the ttl as a guint32.

Gio::ResolverRecordType::NS records are returned as variants with the signature '(s)', representing a string of the hostname of the name server.

Since glibmm 2.34:
Enumerator
SRV 

Lookup DNS SRV records for a domain.

MX 

Lookup DNS MX records for a domain.

TXT 

Lookup DNS TXT records for a name.

SOA 

Lookup DNS SOA records for a zone.

NS 

Lookup DNS NS records for a domain.

The type of name used by a UnixSocketAddress.

Gio::UnixSocketAddressType::PATH indicates a traditional unix domain socket bound to a filesystem path. Gio::UnixSocketAddressType::ANONYMOUS indicates a socket not bound to any name (eg, a client-side socket, or a socket created with socketpair()).

For abstract sockets, there are two incompatible ways of naming them; the man pages suggest using the entire struct sockaddr_un as the name, padding the unused parts of the sun_path field with zeroes; this corresponds to Gio::UnixSocketAddressType::ABSTRACT_PADDED. However, many programs instead just use a portion of sun_path, and pass an appropriate smaller length to bind() or connect(). This is Gio::UnixSocketAddressType::ABSTRACT.

Since glibmm 2.26:
Enumerator
INVALID 

Invalid.

ANONYMOUS 

Anonymous.

PATH 

A filesystem path.

ABSTRACT 

An abstract name.

ABSTRACT_PADDED 

An abstract name, 0-padded to the full length of a unix socket name.

enum Gio::Socket::Type
strong

Flags used when creating a Socket.

Some protocols may not implement all the socket types.

Since glibmm 2.22:
Enumerator
INVALID 

Type unknown or wrong.

STREAM 

Reliable connection-based byte streams (e.g.

TCP).

DATAGRAM 

Connectionless, unreliable datagram passing.

(e.g. UDP).

SEQPACKET 

Reliable connection-based passing of datagrams of fixed maximum length (e.g.

SCTP).

Function Documentation

SignalSocket Gio::signal_socket ( const Glib::RefPtr< Glib::MainContext >&  context = Glib::RefPtrGlib::MainContext >())

Convenience socket signal.

Parameters
contextThe main context to which the signal shall be attached.
Returns
A signal proxy; you want to use SignalSocket::connect().
Since glibmm 2.42: