Ejemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            // Do not call base.Dispose. We do not want the AsyncSemaphore instances to be disposed due to a race
            // condition.

            if (disposing)
            {
                ReceivingStream?.Dispose();
                SendingStream?.Dispose();
            }
        }
Ejemplo n.º 2
0
        protected override void Dispose(bool disposing)
        {
            // Do not call base.Dispose. We do not want the AsyncSemaphore instances to be disposed due to a race
            // condition.

            if (disposing)
            {
                // note that this can cause double disposing of a stream if both are based on same stream.
                // we can't check whether 2 are same because one of them could be wrapped stream such as bufferedstream which
                // underneath points to same stream.
                ReceivingStream?.Dispose();
                SendingStream?.Dispose();
            }
        }
Ejemplo n.º 3
0
        public Gateway(IActorRef connection)
        {
            DataStream = new ReceivingStream();

            Connection = connection;
            Context.Watch(connection);

            Receive <Tcp.Received>(received => OnReceivedData(received));
            Receive <Tcp.ConnectionClosed>(closed =>
            {
                Console.WriteLine("Disconnected");
                Context.Stop(Self);
            });

            Receive <Terminated>(terminated =>
            {
                Console.WriteLine("Disconnected");
                Context.Stop(Self);
            });
        }
Ejemplo n.º 4
0
 public void Setup()
 {
     stream = new ReceivingStream();
 }