Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZMQ 3.0 ZmqContext.Create() After a period of time can not work #171

Open
reakipanyi opened this issue May 8, 2017 · 0 comments
Open

ZMQ 3.0 ZmqContext.Create() After a period of time can not work #171

reakipanyi opened this issue May 8, 2017 · 0 comments

Comments

@reakipanyi
Copy link

I have met at least three times, when the program is running a few days later, the client program or Server program using (ZmqContext) = ZmqContext.Create (context) will be stuck, I need to restart the server to work properly

This is my code
Server:
using (ZmqContext context = ZmqContext.Create())
using (ZmqSocket server = context.CreateSocket(SocketType.REP))
{
server.Bind("tcp://*:9800");
while (true)
{
.....
}
}
Client:
using (ZmqContext context = ZmqContext.Create())
using (ZmqSocket client = context.CreateSocket(ZeroMQ.SocketType.REQ))
{
client.ReceiveTimeout = new TimeSpan(0, 0, 30);
client.Connect("tcp://127.0.0.1:9800" );
string con ="...";
client.Send(con, System.Text.Encoding.Unicode);
string Recv = client.Receive(System.Text.Encoding.Unicode);
.....
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant