Planeshift
Classes | Defines | Typedefs | Enumerations | Functions | Variables

Common_net

Classes

class  ClientMsgHandler
class  CmdHandler
struct  CmdSubscription
class  NetBase::Connection
 This class holds data for a connection. More...
class  csComparator< csRef< psNetPacketEntry >, csRef< psNetPacketEntry > >
class  csHashComputer< PacketKey >
class  csSyncRefCount
struct  iCmdSubscriber
 This interface must be implemented by objects that want to receive command line strings messages. More...
struct  iNetSubscriber
 This interface must be implemented by objects that want to receive network messages. More...
class  MsgEntry
 The structure of 1 queue entry (pointer to a message) More...
class  MsgHandler
 This class is the client's and server's main interface for either sending network messages out or getting notified about inbound ones which have been received. More...
class  NetBase
 This class acts as a base for client/server net classes. More...
class  NetPacketQueueRefCount
struct  OrderedMessageChannel
 This class holds the structure for guaranteed inbound ordering of certain message types. More...
class  PacketKey
class  psClientNetSubscriber
class  psCmdBase
struct  psMessageBytes
 this struct represents the data that is sent out through the network (all additional stuff should go into the struct MsgEntry More...
class  psNetConnection
 Client-side UDP handler. More...
class  psNetInfos
 Gives informations about the network connection. More...
class  psNetMsgProfiles
 Statistics of receiving or sending of network messages. More...
struct  psNetPacket
 psNetPacket gives the networking code the context it needs, and all of this info goes out on the wire. More...
class  psNetPacketEntry
class  psServerPinger
 Class psServerPinger takes care about sending pings to a server in Login screen. More...
struct  PublishDestination
struct  Subscription
 Manages a iNetSubscriber watching a certain message type. More...

Defines

#define IN_ADDR   struct in_addr
#define INET_ADDRSTRLEN   22
#define INVALID_SOCKET   -1
#define LPSOCKADDR   struct sockaddr *
#define LPSOCKADDR_IN   struct sockaddr_in *
#define MAXCLIENTQUEUESIZE   5000
#define MAXPACKETHISTORY   1009
#define MAXQUEUESIZE   20000
#define MSG_SIZEOF_FLOAT   sizeof(uint32)
#define MSG_SIZEOF_SECTOR   100
#define MSG_SIZEOF_VECTOR2   (2*sizeof(uint32))
#define MSG_SIZEOF_VECTOR3   (3*sizeof(uint32))
#define MSG_SIZEOF_VECTOR4   (4*sizeof(uint32))
#define NETAVGCOUNT   400
#define NETINFOS_TICKARRAYSIZE   10
 Number of entries in the ticks queue for calculating the average.
#define NUM_BROADCAST   0xffffffff
#define PS_PACKED
#define RESENDAVGCOUNT   200
#define SENDTO_MAX_RETRIES   200
#define SENDTO_SELECT_TIMEOUT_SEC   0
#define SENDTO_SELECT_TIMEOUT_USEC   10000
#define SOCK_CLOSE(a)   close(a)
#define SOCK_CLOSE(a)   closesocket(a)
#define SOCK_IOCTL(a, b, c)   ioctl(a,b,c)
#define SOCK_IOCTL(a, b, c)   ioctlsocket(a,b,(unsigned long *)c)
#define SOCK_RECVFROM(a, b, c, d, e, f)   recvfrom(a,(void *) b,c,d,e,f)
#define SOCK_RECVFROM(a, b, c, d, e, f)   recvfrom(a,(char *)b,c,d,e,f)
#define SOCK_SELECT(max, read, write, except, timeout)   select(max,read,write,except,timeout)
#define SOCK_SELECT(max, read, write, except, timeout)   select(max,read,write,except,timeout)
#define SOCK_SENDTO(a, b, c, d, e, f)   sendto(a,(const char *)b,c,d,e,f)
#define SOCK_SENDTO(a, b, c, d, e, f)   sendto(a,(const void *) b,c,d,e,f)
#define SOCKADDR_IN   struct sockaddr_in
#define SOCKET   int
#define socklen_t   int
#define WSAEWOULDBLOCK   EAGAIN

Typedefs

typedef GenericRefQueue< MsgEntryMsgQueue
typedef uint8_t msgtype
typedef GenericRefQueue
< psNetPacketEntry
NetPacketQueue
typedef uint32_t objID

Enumerations

enum  { PRIORITY_LOW = 0x00, PRIORITY_HIGH = 0x01, PRIORITY_MASK = 0x01 }
enum  {
  PKTSIZE_ACK = 0, PKTMINRTO = 250, PKTMAXRTO = 60000, PKTINITRTO = 3000,
  FLAG_MULTIPACKET = 0x02, MAXPACKETSIZE = 1400
}

Functions

static void exitSocket ()
static int initSocket ()

Variables

const unsigned int MAX_MESSAGE_SIZE = 65535 - sizeof(psMessageBytes) - 1
const unsigned int WINDOW_MAX_SIZE = 65536

Define Documentation

#define IN_ADDR   struct in_addr

Definition at line 50 of file sockuni.h.

#define INET_ADDRSTRLEN   22

Definition at line 25 of file sockwin.h.

#define INVALID_SOCKET   -1

Definition at line 80 of file sockuni.h.

#define LPSOCKADDR   struct sockaddr *

Definition at line 63 of file sockuni.h.

#define LPSOCKADDR_IN   struct sockaddr_in *

Definition at line 70 of file sockuni.h.

#define MAXCLIENTQUEUESIZE   5000

Definition at line 43 of file netbase.h.

#define MAXPACKETHISTORY   1009

Definition at line 44 of file netbase.h.

#define MAXQUEUESIZE   20000

Definition at line 42 of file netbase.h.

#define MSG_SIZEOF_FLOAT   sizeof(uint32)

Definition at line 135 of file message.h.

#define MSG_SIZEOF_SECTOR   100

Definition at line 134 of file message.h.

#define MSG_SIZEOF_VECTOR2   (2*sizeof(uint32))

Definition at line 131 of file message.h.

#define MSG_SIZEOF_VECTOR3   (3*sizeof(uint32))

Definition at line 132 of file message.h.

#define MSG_SIZEOF_VECTOR4   (4*sizeof(uint32))

Definition at line 133 of file message.h.

#define NETAVGCOUNT   400

Definition at line 47 of file netbase.h.

#define NETINFOS_TICKARRAYSIZE   10

Number of entries in the ticks queue for calculating the average.

Definition at line 30 of file netinfos.h.

#define NUM_BROADCAST   0xffffffff

Definition at line 41 of file netbase.h.

#define PS_PACKED

Definition at line 12 of file packing.h.

#define RESENDAVGCOUNT   200

Definition at line 48 of file netbase.h.

#define SENDTO_MAX_RETRIES   200

Definition at line 53 of file netbase.h.

#define SENDTO_SELECT_TIMEOUT_SEC   0

Definition at line 55 of file netbase.h.

#define SENDTO_SELECT_TIMEOUT_USEC   10000

Definition at line 57 of file netbase.h.

#define SOCK_CLOSE (   a)    close(a)

Definition at line 77 of file sockuni.h.

#define SOCK_CLOSE (   a)    closesocket(a)

Definition at line 31 of file sockwin.h.

#define SOCK_IOCTL (   a,
  b,
 
)    ioctl(a,b,c)

Definition at line 76 of file sockuni.h.

#define SOCK_IOCTL (   a,
  b,
 
)    ioctlsocket(a,b,(unsigned long *)c)

Definition at line 30 of file sockwin.h.

#define SOCK_RECVFROM (   a,
  b,
  c,
  d,
  e,
 
)    recvfrom(a,(void *) b,c,d,e,f)

Definition at line 75 of file sockuni.h.

#define SOCK_RECVFROM (   a,
  b,
  c,
  d,
  e,
 
)    recvfrom(a,(char *)b,c,d,e,f)

Definition at line 29 of file sockwin.h.

#define SOCK_SELECT (   max,
  read,
  write,
  except,
  timeout 
)    select(max,read,write,except,timeout)

Definition at line 32 of file sockwin.h.

#define SOCK_SELECT (   max,
  read,
  write,
  except,
  timeout 
)    select(max,read,write,except,timeout)

Definition at line 78 of file sockuni.h.

#define SOCK_SENDTO (   a,
  b,
  c,
  d,
  e,
 
)    sendto(a,(const char *)b,c,d,e,f)

Definition at line 28 of file sockwin.h.

#define SOCK_SENDTO (   a,
  b,
  c,
  d,
  e,
 
)    sendto(a,(const void *) b,c,d,e,f)

Definition at line 74 of file sockuni.h.

#define SOCKADDR_IN   struct sockaddr_in

Definition at line 58 of file sockuni.h.

#define SOCKET   int

Definition at line 43 of file sockuni.h.

#define socklen_t   int

Definition at line 38 of file sockwin.h.

#define WSAEWOULDBLOCK   EAGAIN

Definition at line 95 of file netbase.h.


Typedef Documentation

Definition at line 82 of file netbase.h.

typedef uint8_t msgtype

Definition at line 56 of file message.h.

Definition at line 84 of file netbase.h.

typedef uint32_t objID

Definition at line 15 of file pstypes.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
PRIORITY_LOW 
PRIORITY_HIGH 
PRIORITY_MASK 

Definition at line 48 of file message.h.

anonymous enum
Enumerator:
PKTSIZE_ACK 
PKTMINRTO 
PKTMAXRTO 
PKTINITRTO 
FLAG_MULTIPACKET 
MAXPACKETSIZE 

MAXPACKETSIZE includes header length ( sizeof(struct psNetPacket) )

Definition at line 33 of file netpacket.h.


Function Documentation

static void exitSocket ( ) [inline, static]

Definition at line 88 of file sockuni.h.

static int initSocket ( ) [inline, static]

Definition at line 82 of file sockuni.h.


Variable Documentation

const unsigned int MAX_MESSAGE_SIZE = 65535 - sizeof(psMessageBytes) - 1

Definition at line 129 of file message.h.

const unsigned int WINDOW_MAX_SIZE = 65536

Definition at line 50 of file netbase.h.