예제 #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);
        }
예제 #2
0
        protected override void Run()
        {
            using (Backend = ZSocket.Create(Context, ZSocketType.PAIR))
            {
                Backend.Bind(Endpoint);

                Action(Context, Backend, Cancellor, Arguments);
            }
        }
예제 #3
0
        public override void Start()
        {
            base.Start();

            if (Frontend == null)
            {
                Frontend = ZSocket.Create(Context, ZSocketType.PAIR);
                Frontend.Connect(Endpoint);
            }
        }
예제 #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);
                }
            }
        }