Gamedev Framework (gf)  0.17.0
A C++14 framework for 2D games
Classes | Typedefs | Enumerations | Variables
Network sockets

The classes related to socket handling. More...

Classes

struct  gf::Packet
 A packet of bytes. More...
 
struct  gf::SocketDataResult
 The result of a socket operation. More...
 
class  gf::Socket
 A network socket. More...
 
class  gf::SocketAddress
 A socket address. More...
 
class  gf::SocketGuard
 A guard to handle library initialization. More...
 
class  gf::SocketSelector
 A socket selector. More...
 
class  gf::TcpListener
 A TCP listener. More...
 
class  gf::TcpSocket
 A TCP socket. More...
 
class  gf::UdpSocket
 A UDP socket. More...
 

Typedefs

using gf::SocketHandle = implementation-defined
 A native socket handle. More...
 

Enumerations

enum  gf::SocketStatus {
  gf::SocketStatus::Data,
  gf::SocketStatus::Block,
  gf::SocketStatus::Close,
  gf::Error
}
 The status of a socket operation. More...
 
enum  gf::SocketFamily : int {
  gf::SocketFamily::Unspec = AF_UNSPEC,
  gf::SocketFamily::IPv4 = AF_INET,
  gf::SocketFamily::IPv6 = AF_INET6
}
 A socket family. More...
 
enum  gf::SocketAddressFormat {
  gf::SocketAddressFormat::Unrestricted,
  gf::SocketAddressFormat::Numeric
}
 A socket address format. More...
 
enum  gf::SocketSelectorStatus {
  gf::Event,
  gf::Timeout,
  gf::Error,
  gf::Error
}
 The status of the selector. More...
 

Variables

constexpr SocketHandle gf::InvalidSocketHandle = implemetation-defined
 An invalid socket handle. More...
 

Detailed Description

The classes related to socket handling.

Typedef Documentation

◆ SocketHandle

using gf::SocketHandle = typedef implementation-defined

A native socket handle.

This type represents the native socket type. It is implementation-defined. Normally, you should not have to manipulate this type.

See also
gf::TcpListener, gf::TcpSocket, gf::UdpSocket

Enumeration Type Documentation

◆ SocketAddressFormat

A socket address format.

See also
gf::SocketAddress
Enumerator
Unrestricted 

Allow name resolution for the address.

Numeric 

Use a numeric form for the address.

◆ SocketFamily

enum gf::SocketFamily : int
strong

A socket family.

A socket family indicates the type of the socket. The family can be specified explicitly or unspecified, in which case the family is set automatically by the system.

See also
gf::SocketAddress
Enumerator
Unspec 

Unspecified (either IPv4 or IPv6)

IPv4 

IPv4 (Internet Protocol version 4)

IPv6 

IPv6 (Internet Protocol version 6)

◆ SocketSelectorStatus

The status of the selector.

Enumerator
Event 

An event is pending on the sockets.

Timeout 

The call timed out.

Error 

An error occurred.

Error 

An error occurred.

◆ SocketStatus

enum gf::SocketStatus
strong

The status of a socket operation.

See also
gf::SocketDataResult
Enumerator
Data 

Some data has been sent or received.

Block 

The socket would have blocked.

Close 

The connection is closed.

Error 

An error occurred.

Variable Documentation

◆ InvalidSocketHandle

constexpr SocketHandle gf::InvalidSocketHandle = implemetation-defined

An invalid socket handle.

This constant is used internally to represent an invalid socket. It is implementation-defined. Normally, you should not have to manipulate this constant.

See also
gf::SocketHandle, gf::Socket