Exemplo n.º 1
0
        protected virtual bool Initialize(ZSocketType frontendType, ZSocketType backendType, out ZError error)
        {
            error = default(ZError);

            /* if (frontendType == ZSocketType.None && backendType == ZSocketType.None)
             * {
             *      throw new InvalidOperationException();
             * } /**/

            if (frontendType != ZSocketType.None)
            {
                if (null == (FrontendSocket = ZSocket.Create(Context, frontendType, out error)))
                {
                    return(false);
                }
                FrontendSetup = new ZSocketSetup(FrontendSocket);
            }

            if (backendType != ZSocketType.None)
            {
                if (null == (BackendSocket = ZSocket.Create(Context, backendType, out error)))
                {
                    return(false);
                }
                BackendSetup = new ZSocketSetup(BackendSocket);
            }

            return(true);
        }
Exemplo n.º 2
0
        protected override void Run()
        {
            using (Backend = ZSocket.Create(Context, ZSocketType.PAIR))
            {
                Backend.Bind(Endpoint);

                Action(Context, Backend, Cancellor, Arguments);
            }
        }
Exemplo n.º 3
0
        public override void Start()
        {
            base.Start();

            if (Frontend == null)
            {
                Frontend = ZSocket.Create(Context, ZSocketType.PAIR);
                Frontend.Connect(Endpoint);
            }
        }
Exemplo n.º 4
0
        protected override void Run()
        {
            using (Backend = ZSocket.Create(Context, ZSocketType.PAIR))
            {
                Backend.Bind(Endpoint);

                if (Action0 != null)
                {
                    Action0(Backend, Arguments);
                }
                if (Action != null)
                {
                    Action(Context, Backend, Arguments);
                }
            }
        }