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

Subscribe not working. #95

Closed
abhijithch opened this issue Oct 7, 2015 · 1 comment
Closed

Subscribe not working. #95

abhijithch opened this issue Oct 7, 2015 · 1 comment

Comments

@abhijithch
Copy link

I have Published through c# on a certain port, and I have verified by subscribing through C#. But when I am trying to subscribe through julia (0.3.11) on windows, using the below mentioned code :

ctx = Context(2)
s1 = Socket(ctx, SUB)
ZMQ.subscribe(s1)
ZMQ.connect(s1, "tcp://127.0.0.1:50001")
msg = ZMQ.recv(s1)

It just hangs, am I missing something? I am not very sure if this is an issue or I am missing something. Documentation does not have examples for PUB/SUB.

@stevengj
Copy link
Contributor

stevengj commented Oct 7, 2015

This works for me:

ctx = Context()

p = Socket(ctx, PUB)
ZMQ.bind(p, "tcp://127.0.0.1:50001")

s = Socket(ctx, SUB)
ZMQ.subscribe(s)
ZMQ.connect(s, "tcp://127.0.0.1:50001")

ZMQ.send(p, Message("test message"))
msg = bytestring(ZMQ.recv(s))

(At least from the REPL; I have some problem running in this IJulia, maybe because IJulia is already using ZMQ? I'm not sure why there would be an interaction.)

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

3 participants