Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 public NetworkOutput(NetworkConnectionPool connections)
 {
     ClientConnections = connections;
 }
Ejemplo n.º 3
0
 public NetworkErrorHandling(NetworkConnectionPool connections, NetworkInterface parent)
 {
     ParentNetwork     = parent;
     ClientConnections = connections;
 }