コード例 #1
0
        internal ServerConnection(Socket socket, TlsSecurityInformation tlsSecInfo, ConnectionParameters parameters, Server server, ASDUQueue asduQueue, bool debugOutput)
        {
            connectionsCounter++;
            connectionID = connectionsCounter;

            this.parameters  = parameters;
            this.server      = server;
            this.asduQueue   = asduQueue;
            this.debugOutput = debugOutput;

            ResetT3Timeout();

            maxSentASDUs   = parameters.K;
            this.sentASDUs = new SentASDU[maxSentASDUs];

            //TODO only needed when connection is activated
            receivedASDUs        = new Queue <ASDU> ();
            waitingASDUsHighPrio = new Queue <BufferFrame> ();

            socketStream    = new NetworkStream(socket);
            this.socket     = socket;
            this.tlsSecInfo = tlsSecInfo;

            Thread workerThread = new Thread(HandleConnection);

            workerThread.Start();
        }
コード例 #2
0
        public Server(ConnectionParameters parameters, TlsSecurityInformation securityInfo)
        {
            this.parameters   = parameters;
            this.securityInfo = securityInfo;

            if (securityInfo != null)
            {
                this.localPort = 19998;
            }
        }