Пример #1
0
                public ListenerParent(TestSetup test, bool pullMode)
                {
                    _test     = test;
                    _pullMode = pullMode;

                    var endpoint = new IPEndPoint(IPAddress.Loopback, 0);

                    _listener = Context.ActorOf(Props.Create(() =>
                                                             new TcpListener(
                                                                 Tcp.Instance.Apply(Context.System),
                                                                 test._bindCommander.Ref,
                                                                 new Tcp.Bind(
                                                                     _test._handler.Ref,
                                                                     endpoint,
                                                                     100,
                                                                     new Inet.SocketOption[] { new TestSocketOption(socket => _test.AfterBind(socket)) },
                                                                     pullMode)))
                                                .WithDeploy(Deploy.Local));

                    _test._parent.Watch(_listener);
                }