Initial commit

This commit is contained in:
2026-04-03 00:22:39 -05:00
commit eca1e8c458
945 changed files with 218160 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
/*
ZNetConsts.hpp
Author: Patrick Baggett <ptbaggett@762studios.com>
Created: 6/5/2013
Purpose:
ZNet symbolic constants
License:
Copyright 2013, 762 Studios
*/
#pragma once
#ifndef _ZNETCONSTS_HPP
#define _ZNETCONSTS_HPP
#define ZNET_MTU_IPV4SAFE 512 //Like ZNET_MTU_IPV4, but with slightly less space, allowing for 64 bytes of IP overhead via optional sections
#define ZNET_MTU_IPV4 548 //Minimum maximum reassembly buffer size of 576 minus 28 bytes of overhead for UDPv4
#define ZNET_MTU_ETHERNET 1500
#define ZNET_MTU_IPV6 1280
#define ZNET_MTU_IPV6SAFE 1232 //IPv6 required 1280 minus 48 for UDPv6+IPv6 header
#define ZNET_MAX_SERVER_SOCKETS 4 //Maximum number of sockets a server may listen on
//Flags for ZNetPacket::Initialize()
#define ZNET_TRANSIENT 0x00000000u //< Default value. The packet is unreliable, but transient, so the newest copy is presented and older version discarded.
#define ZNET_RELIABLE 0x00000001u //< This packet will be reliable.
//Peer state
enum ZNetConnectionState
{
STATE_UNCONNECTED, //No connection(s) established
STATE_HANDSHAKE, //Machine has attempted connection, awaiting handshake
STATE_CONNECTED, //Machine is connected actively to a remote machine
STATE_SERVING //Clients connected, actively serving them
};
#endif