Exemplo n.º 1
0
        internal ClientConnection(Socket socket, TlsSecurityInformation tlsSecInfo, APCIParameters apciParameters, ApplicationLayerParameters parameters, Server server, ASDUQueue asduQueue, bool debugOutput)
        {
            connectionsCounter++;
            connectionID = connectionsCounter;

            this.remoteEndpoint = (IPEndPoint)socket.RemoteEndPoint;

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

            ResetT3Timeout();

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

            receivedASDUs        = new ConcurrentQueue <ASDU> ();
            waitingASDUsHighPrio = new Queue <BufferFrame> ();

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

            this.fileServer = new FileServer(this, server.GetAvailableFiles(), DebugLog);

            Thread workerThread = new Thread(HandleConnection);

            workerThread.Start();
        }
Exemplo n.º 2
0
        public Server(APCIParameters apciParameters, ApplicationLayerParameters alParameters, TlsSecurityInformation securityInfo)
        {
            this.apciParameters = apciParameters;
            this.alParameters   = alParameters;
            this.securityInfo   = securityInfo;

            if (securityInfo != null)
            {
                this.localPort = 19998;
            }
        }
Exemplo n.º 3
0
        public APCIParameters Clone()
        {
            APCIParameters copy = new APCIParameters();

            copy.k  = k;
            copy.w  = w;
            copy.t0 = t0;
            copy.t1 = t1;
            copy.t2 = t2;
            copy.t3 = t3;

            return(copy);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Create a new server using the provided connection parameters.
 /// </summary>
 /// <param name="parameters">Connection parameters</param>
 public Server(APCIParameters apciParameters, ApplicationLayerParameters alParameters)
 {
     this.apciParameters = apciParameters;
     this.alParameters   = alParameters;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a new server using default connection parameters
 /// </summary>
 public Server()
 {
     this.apciParameters = new APCIParameters();
     this.alParameters   = new ApplicationLayerParameters();
 }
Exemplo n.º 6
0
 public Server(uint port)
 {
     this.localPort      = (int)port;
     this.apciParameters = new APCIParameters();
     this.alParameters   = new ApplicationLayerParameters();
 }