-
Notifications
You must be signed in to change notification settings - Fork 58
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
Basics Publisher Example Crashes #223
Comments
I can confirm the issue on my side for the publisher. Edit: subscribe code can be using ZMQ
context = Context()
socket = Socket(context, SUB)
println("Collecting updates from weather server...")
connect(socket, "tcp://localhost:5556")
# Subscribe to zipcode, default is NYC, 10001
zip_filter = length(ARGS) > 0 ? ARGS[1] : "10001"
subscribe(socket, zip_filter)
while true
message = unsafe_string(recv(socket))
println(message)
end
# Making a clean exit.
close(socket)
close(context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The example publisher in the Basics section of the ZMQ Guide crashes if put in a function. See this:
Which results in:
Everthing is fine if the code is not encapsulated inside a function:
I'm on Windows 11 running Julia v1.8.5 with ZMQ v1.2.2.
Any idea what I could have done wrong? It seems to me like a rather simple change that couldn't really hurt, but apparently I have been proven wrong and could have misused the API.
The text was updated successfully, but these errors were encountered: