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); }
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>(); }
public SenderActor(Connection parent, ActorManager actorManager) : base(actorManager) { this.parent = parent; this.toSend = new Queue<SegmentHandlePair>(); this.transportSendInProgress = false; }
public ChannelReceivingActor(TransportReceivingActor parent, ActorManager actorManager) : base(actorManager) { this.parent = parent; this.data = new Queue<SegmentWrapper>(); this.accepted = false; }
public Actor(ActorManager actorManager) { this.actorManager = actorManager; this.mailBox = new Queue<IMessage>(); this.state = ActorState.Idle; }