示例#1
0
        private void StartConnection(int assignedClientId)
        {
            this.clientId = assignedClientId;

            this.connectedEvent.Set();
            this.SetNewConnectionState(ConnectionState.Connected);

            this.requestPool = new RequestPool <TClientControlFrameType>(this.transportLayer, this.InitialPollingPoolSize);

            this.requestPool.ClientId = this.clientId;
            this.requestPool.Start();

            this.receivedDataTimeoutTimer.Change(this.receiveTimeout, Timeout.InfiniteTimeSpan);
            this.sendKeepAlivePacketTimer.Change(this.protocolSpecification.KeepAliveClientInterval, this.protocolSpecification.KeepAliveClientInterval);
        }
示例#2
0
 protected virtual void Dispose(bool forceAll)
 {
     this.requestPool.StopAsync();
     this.requestPool = null;
 }