CodePudding user response:
Class Program{
The static void Main (string [] args)
{
Using (NetMQSocket clientSocket=new StreamSocket ())
{
NetMQProactor proactor=new NetMQProactor (clientSocket, intrinsic ProcessMessage);
NetMQBeacon n=new NetMQBeacon ();
Random rd=new Random();
Int num=rd. Next (0, 100);
ClientSocket. Connect (" TCP://127.0.0.1:5003 ");
While (true)
{
Console. WriteLine (num + ", both Please enter your message: ");
String message=Console. ReadLine ();
ClientSocket. SendMoreFrame (clientSocket. Options. Identity);
ClientSocket. SendFrame (num + ":" + message);
If (message=="exit")
{
break;
}
}
}
}
Public static void intrinsic ProcessMessage (NetMQSocket socket, NetMQMessage message)
{
Byte [] serverId=message. First. The ToByteArray (true);
String answer=System. Text. Encoding. The Default. Get string (message. Last. Buffer);
Console. WriteLine (" the Answer from the server: {0} ", Answer);
}
}
CodePudding user response:
The server was developed by other companies, can not ask them?CodePudding user response:
A ping, ping can generally is not open,CodePudding user response:
NetMQSocket I program inside this has been an error, don't know what circumstance, again, the lack of reference, has anyone bosses know it