protected NetworkInterface(UDPConnection udpConnection, Logger logger)
        {
            Logger = logger;

            ClientConnections = new NetworkConnectionPool();
            In  = new NetworkInput(ClientConnections);
            Out = new NetworkOutput(ClientConnections);

            ErrorHandling = new NetworkErrorHandling(ClientConnections, this);

            UdpConnection                 = udpConnection;
            UdpConnection.Logger          = logger;
            UdpConnection.OnReceiveError += ErrorHandling.HandleUDPReceiveError;
            UdpConnection.OnSendError    += ErrorHandling.HandleUDPSendError;
            UdpConnection.InitializeReceiving();

            KeepAliveInterval = 1000;
            m_keepAlive       = true;

            HolePunchingInterval = 1000;
            m_holePunching       = false;

            Thread keepAliveThread = new Thread(KeepAliveLoop);

            keepAliveThread.Name = "Keep alive";
            keepAliveThread.Start();
        }
Example #2
0
 public NetworkOutput(NetworkConnectionPool connections)
 {
     ClientConnections = connections;
 }
 public NetworkErrorHandling(NetworkConnectionPool connections, NetworkInterface parent)
 {
     ParentNetwork     = parent;
     ClientConnections = connections;
 }