Nexus Engine  v0.0.1
Loading...
Searching...
No Matches
Nexus::Network Namespace Reference

Namespaces

namespace  Internal
namespace  Wire
 Wire values are always sent big-endian.

Classes

class  NetworkAddress
struct  NetworkError
class  NetworkManager
class  Packet
class  PacketDispatcher
struct  PacketHeader
class  PacketWriter
class  Socket
class  StreamReassembler
class  TCPClient
class  TCPServer
struct  UDPMessage
class  UDPSocket

Typedefs

using NativeSocketHandle = uptr
using ClientId = uint32

Enumerations

enum class  NetworkErrorCode {
  None , WouldBlock , ConnectionInProgress , ConnectionClosed ,
  ConnectionReset , ConnectionAborted , ConnectionRefused , NotConnected ,
  AddressInUse , HostUnreachable , NetworkUnreachable , Timeout ,
  MessageTooLarge , InvalidAddress , PermissionDenied , InvalidOperation ,
  Unknown
}
enum class  SocketType { TCP , UDP }
enum class  PacketType : uint16 {
  ClientHello , ServerHello , PlayerInput , PlayerState ,
  SpawnEntity , DestroyEntity , ChatMessage
}

Functions

NetworkError TranslateLastSocketError ()

Variables

constexpr NativeSocketHandle INVALID_SOCKET = ~0
constexpr usize HEADER_SIZE = sizeof(uint32) + sizeof(PacketType) + sizeof(uint32)
constexpr uint32 MAX_PAYLOAD_SIZE = 1u << 20
constexpr usize MAX_FRAME_SIZE = HEADER_SIZE + static_cast<usize>(MAX_PAYLOAD_SIZE)
constexpr usize MAX_UDP_PAYLOAD = 65507

Typedef Documentation

◆ ClientId

◆ NativeSocketHandle

Enumeration Type Documentation

◆ NetworkErrorCode

enum class Nexus::Network::NetworkErrorCode
exportstrong
Enumerator
None 
WouldBlock 
ConnectionInProgress 
ConnectionClosed 
ConnectionReset 
ConnectionAborted 
ConnectionRefused 
NotConnected 
AddressInUse 
HostUnreachable 
NetworkUnreachable 
Timeout 
MessageTooLarge 
InvalidAddress 
PermissionDenied 
InvalidOperation 
Unknown 

◆ PacketType

enum class Nexus::Network::PacketType : uint16
exportstrong
Enumerator
ClientHello 
ServerHello 
PlayerInput 
PlayerState 
SpawnEntity 
DestroyEntity 
ChatMessage 

◆ SocketType

enum class Nexus::Network::SocketType
exportstrong
Enumerator
TCP 
UDP 

Function Documentation

◆ TranslateLastSocketError()

NEXUS_API NetworkError Nexus::Network::TranslateLastSocketError ( )
nodiscardexport

Variable Documentation

◆ HEADER_SIZE

usize Nexus::Network::HEADER_SIZE = sizeof(uint32) + sizeof(PacketType) + sizeof(uint32)
inlineconstexprexport

◆ INVALID_SOCKET

NativeSocketHandle Nexus::Network::INVALID_SOCKET = ~0
inlineconstexprexport

◆ MAX_FRAME_SIZE

usize Nexus::Network::MAX_FRAME_SIZE = HEADER_SIZE + static_cast<usize>(MAX_PAYLOAD_SIZE)
inlineconstexprexport

◆ MAX_PAYLOAD_SIZE

uint32 Nexus::Network::MAX_PAYLOAD_SIZE = 1u << 20
inlineconstexprexport

◆ MAX_UDP_PAYLOAD

usize Nexus::Network::MAX_UDP_PAYLOAD = 65507
inlineconstexprexport