public void HelloWorld(Action <object> callBack) { var method = new HelloWorldMethod() { param1 = "yo from the slaveOwner" }; var encodedMethod = NetMqEncoder.GenerateServerModuleMethodMessage(this.serverModuleID, this.callIDManager.RegisterCall(callBack), method); this.reqSocket.SendMultipartMessage(encodedMethod); }
protected static HelloWorldMethod DecodeServerMethodHelloWorld(NetMQMessage message) { var result = new HelloWorldMethod(); //result.MethodId = methoId; if (1 != message.FrameCount) { throw new MethodFailedException("Not the right amount of frames"); } var thirdFrame = message.Pop(); result.param1 = (GetFromFrameString(thirdFrame)); return(result); }
//most basic method with no real purpose protected static NetMQMessage GenerateHelloWorldMessage(NetMQMessage message, HelloWorldMethod method) { message.Append(GetFrame(HelloWorldMethod.METHOD_NAME)); //AppendMethodIdFrame(message, method.MethodId); message.Append(GetFrame(method.param1)); return(message); }