Exemple #1
0
 public NetSocket(ConnectionAddressType addrType)
 {
     _socketAddressFamily =
         addrType == ConnectionAddressType.IPv4 ?
         AddressFamily.InterNetwork :
         AddressFamily.InterNetworkV6;
 }
Exemple #2
0
 /// <summary>
 /// Creates server object
 /// </summary>
 /// <param name="listener">Listener of server events</param>
 /// <param name="addressType">Type of connection IPv4 or IPv6</param>
 /// <param name="maxClients">Maximum clients</param>
 /// <param name="key">Application key to identify connecting clients</param>
 public NetServer(INetEventListener listener, ConnectionAddressType addressType, int maxClients, string key) : base(listener, addressType)
 {
     _peers             = new Dictionary <NetEndPoint, NetPeer>();
     _peerConnectionIds = new Dictionary <NetEndPoint, ulong>();
     _peersToRemove     = new Queue <NetEndPoint>(maxClients);
     _maxClients        = maxClients;
     _connectKey        = key;
 }
Exemple #3
0
 protected NetBase(INetEventListener listener, ConnectionAddressType addressType)
 {
     _socket           = new NetSocket(addressType);
     _addressType      = addressType;
     _netEventListener = listener;
     _flowModes        = new List <FlowMode>();
     _netEventsQueue   = new Queue <NetEvent>();
     _netEventsPool    = new Stack <NetEvent>();
     _remoteEndPoint   = new NetEndPoint(_addressType, 0);
     NatPunchModule    = new NatPunchModule(this, _socket);
 }
Exemple #4
0
 public NetClient(INetEventListener listener, string connectKey, ConnectionAddressType addressType) : base(listener, addressType)
 {
     _connectKey = connectKey;
 }
Exemple #5
0
 //Socket constructor
 public NetSocket(ConnectionAddressType connectionAddressType)
 {
 }
Exemple #6
0
 internal NetEndPoint(ConnectionAddressType addressType, int port)
 {
     EndPoint = new IPEndPoint(addressType == ConnectionAddressType.IPv4 ? IPAddress.Any : IPAddress.IPv6Any, port);
 }
Exemple #7
0
 internal NetEndPoint(ConnectionAddressType addressType, int port)
 {
     HostName = null;
     PortStr  = port.ToString();
     Port     = port;
 }