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

Socket#connect hangs for ever on wrong host/port #918

Open
patri9ck opened this issue Jul 6, 2022 · 0 comments
Open

Socket#connect hangs for ever on wrong host/port #918

patri9ck opened this issue Jul 6, 2022 · 0 comments

Comments

@patri9ck
Copy link

patri9ck commented Jul 6, 2022

Consider this code:

try (ZContext zContext = new ZContext(); ZMQ.Socket client = zContext.createSocket(SocketType.REQ)) {
            client.setLinger(0);
            client.setSendTimeOut(0);
            client.setReceiveTimeOut(0);

            client.setImmediate(false);

            client.connect("tcp://" + host + ":" + port);

The connect call blocks the thread for ever if host is for example 223232 and port 22323 (something that doesn't make sense). For my application the host and port rely on user input so that is a problem. Can that be somehow avoided from happening?

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