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); }
protected override void Run() { using (Backend = ZSocket.Create(Context, ZSocketType.PAIR)) { Backend.Bind(Endpoint); Action(Context, Backend, Cancellor, Arguments); } }
public override void Start() { base.Start(); if (Frontend == null) { Frontend = ZSocket.Create(Context, ZSocketType.PAIR); Frontend.Connect(Endpoint); } }
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); } } }