Example #1
0
        public Connection(Socket socket, ConnectionType connectionType)
        {
            this.socket = socket;
            this.connectionType = connectionType;

            this.channels = new Dictionary<int, Channel>();
            if (connectionType == ConnectionType.Client)
            {
                this.nextChannelId = 1;
            }
            else
            {
                this.nextChannelId = 2;
            }

            this.actorManager = new ActorManager();
            this.senderActor = new SenderActor(this, this.actorManager);
            this.transportReceivingActor = new TransportReceivingActor(this, this.actorManager);
            this.actorManager.RunActor(this.senderActor);
            this.actorManager.RunActor(this.transportReceivingActor);
        }
Example #2
0
 public TransportReceivingActor(Connection parent, ActorManager actorManager)
     : base(actorManager)
 {
     this.parent = parent;
     this.buffer = new byte[Constants.BufferSize];
     this.bufferStart = 0;
     this.bufferFull = false;
     this.decodingState = new DecodingState();
     this.pendingAcceptRequests = new Queue<AcceptAsyncResult>();
     this.pendingAcceptChannels = new Queue<Channel>();
     this.channelReceivingActors = new Dictionary<int, ChannelReceivingActor>();
 }
Example #3
0
 public SenderActor(Connection parent, ActorManager actorManager)
     : base(actorManager)
 {
     this.parent = parent;
     this.toSend = new Queue<SegmentHandlePair>();
     this.transportSendInProgress = false;
 }
Example #4
0
 public ChannelReceivingActor(TransportReceivingActor parent, ActorManager actorManager)
     : base(actorManager)
 {
     this.parent = parent;
     this.data = new Queue<SegmentWrapper>();
     this.accepted = false;
 }
Example #5
0
 public Actor(ActorManager actorManager)
 {
     this.actorManager = actorManager;
     this.mailBox = new Queue<IMessage>();
     this.state = ActorState.Idle;
 }