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

Connect/Send no error message if server is not available #15

Closed
alexanderwwagner opened this issue Dec 22, 2022 · 3 comments
Closed

Connect/Send no error message if server is not available #15

alexanderwwagner opened this issue Dec 22, 2022 · 3 comments

Comments

@alexanderwwagner
Copy link

alexanderwwagner commented Dec 22, 2022

Describe the Bug
I try to use your library with the environment which I described below.
If I call socket.connect and Socket.send if no Server is available there is no error message and no effect... so I can not detect, that something is not okay?

Environment
OS: Archlinux 6.0.12-arch1-1
Android x86 emulator: Pixel 5 API 30
flutter: 3.3.9
compileSdkVersion 33
ndkVersion flutter.ndkVersion

To Reproduce

  // Send a test message
  // => via zmq
  testzmq() {
    // Tst
    final ZContext context = ZContext();
    final ZSocket socket = context.createSocket(SocketType.req);
    socket.connect("tcp://localhost:6555");
    //socket.sendString("Hello");
    socket.send([1, 2]);
    socket.close();
  }

Expected Behavior
Error message if I can not connect to server / Get Stuck on server.connect

Reproducibility
100%

@alexanderwwagner alexanderwwagner changed the title Connect/Send not working without any error message Connect/Send no error message if server is not abailable Dec 22, 2022
@alexanderwwagner alexanderwwagner changed the title Connect/Send no error message if server is not abailable Connect/Send no error message if server is not available Dec 22, 2022
@enwi
Copy link
Owner

enwi commented Dec 22, 2022

Hey @alexanderwwagner that behavior is to be expected. Please take a look at the official ZeroMQ documentation.

If you want to figure out if a socket is really connected to an endpoint please take a look at the monitor function. Though I think those methods need to be added to this library first.

@alexanderwwagner
Copy link
Author

As far as I can remember, I thought there was a timeout at this point in the python library... But then I apparently got something wrong. I checked the behavior of the python library again... its the same.
So thank you for your help I will have a look on the links.

@enwi
Copy link
Owner

enwi commented Dec 29, 2022

@alexanderwwagner I have published a new version that introduces the ZMonitor and the MonitoredZSocket with which you can receive socket events that tell you the state of the socket

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

No branches or pull requests

2 participants