Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public ChannelReceivingActor(TransportReceivingActor parent, ActorManager actorManager)
     : base(actorManager)
 {
     this.parent = parent;
     this.data = new Queue<SegmentWrapper>();
     this.accepted = false;
 }