I am just Started Using NETMQ REQ/RES pattern to send and receive the request response from both ends. Client is from IIS and server is from windows service. My question is when i had stopped the service and tried a client request. The client went to infinite LOOP and doesnt return.
Server Code
using (var server = new ResponseSocket())
{
server.Bind("tcp://10.150.0.242:5556");
while (true)
{
try
{
// using (var client = ctx.CreateRequestSocket())
{
string fromClientMessage = server.ReceiveString();
string result = DigitalSignInitialization(fromClientMessage);
server.Send(result);
Console.WriteLine("From Client: {0}", fromClientMessage);
}
}
catch(Exception Ex) { server.Send("Failure"); }
}
}
Client Code
using (NetMQContext ctx = NetMQContext.Create())
{
using (var client = ctx.CreateRequestSocket())
{
//try
// {
//client.Connect("tcp://10.150.0.242:5556");
client.Connect(strNCODE_ADDRESS);
client.Send(json);
fromServerMessage = client.ReceiveString(new TimeSpan (0, 0, 0, 30));
if(fromServerMessage != "Success")
{
fromServerMessage="Failure";
return "<RESULT><DIGITAL_SIGNATURE>DIgital Signature Failed</DIGITAL_SIGNATURE></RESULT>";
}
}
}
Code cant able to return . Please help me thanks in advance