public NetSocket(ConnectionAddressType addrType) { _socketAddressFamily = addrType == ConnectionAddressType.IPv4 ? AddressFamily.InterNetwork : AddressFamily.InterNetworkV6; }
/// <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; }
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); }
public NetClient(INetEventListener listener, string connectKey, ConnectionAddressType addressType) : base(listener, addressType) { _connectKey = connectKey; }
//Socket constructor public NetSocket(ConnectionAddressType connectionAddressType) { }
internal NetEndPoint(ConnectionAddressType addressType, int port) { EndPoint = new IPEndPoint(addressType == ConnectionAddressType.IPv4 ? IPAddress.Any : IPAddress.IPv6Any, port); }
internal NetEndPoint(ConnectionAddressType addressType, int port) { HostName = null; PortStr = port.ToString(); Port = port; }