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

No pull socket? #5

Open
matrixise opened this issue Feb 15, 2014 · 5 comments
Open

No pull socket? #5

matrixise opened this issue Feb 15, 2014 · 5 comments

Comments

@matrixise
Copy link

I try to use a pull socket with ezmq, but I get an error saying there is an error in the socket_type.

#! /usr/bin/env escript
%%! -pa deps/ezmq/ebin -Wall debug verbose

main(_) ->
    {ok, Socket} = ezmq:start([{type, pull}]),
    ezmq:connect(Socket, {127, 0, 0, 1}, 5558, []),
    loop(Socket, 0),

    ok = ezmq:close(Socket).

loop(_Socket, 10) ->
    ok;

loop(Socket, N) ->
    {ok, Request} = ezmq:recv(Socket),
    io:format("Received '~s' ~w~n", [Request, N]),
    loop(Socket, N+1).
escript: exception error: no match of right hand side value {error,invalid_opts}
@RoadRunnr
Copy link

Only req, rep, router, dealer, sub and pub are implemented at the moment.

Locking at the zeromq docs, it seems that dealer is the closest similar behavior. Could you use that as temporary alternative?

BTW: building ezmq_socket_push.erl and ezmq_socket_pull.erl wouldn't take much, but my dev-system is currently down :-(

@hintjens
Copy link
Member

Yes, you can use dealer as substitute for pull or push. Dealer is in fact
identical to the two combined (bidirectional, where pull and push restrict
flow to one direction each).

On Sun, Feb 16, 2014 at 3:47 PM, Andreas Schultz
[email protected]:

Only req, rep, router, dealer, sub and pub are implemented at the moment.

Locking at the zeromq docs, it seems that dealer is the closest similar
behavior. Could you use that as temporary alternative?

BTW: building ezmq_socket_push.erl and ezmq_socket_pull.erl wouldn't take
much, but my dev-system is currently down :-(

Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-35198408
.

@krakatoa
Copy link

Excuse me guys, I couldn't manage to correctly make dealer sends to a pull socket (I'm still quite new to Erlang), would you give me a clue on how to make that work ? :)

@hintjens
Copy link
Member

Dealer can send to dealer, it's exactly the same (except biirectional).

On Tue, Apr 15, 2014 at 12:56 AM, krakatoa [email protected] wrote:

Excuse me guys, I couldn't manage to correctly send dealer sends to a pull
socket (I'm still quite new to Erlang), would you give me a clue on how to
make that work ? :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-40428166
.

@krakatoa
Copy link

Thanks for the hint Pieter! my problem was on understanding the way to send multiple frames on the ezmq:send/2 function. I got it, and now I'm using a combination of dealer-router, sending data as ezmq:send(Socket, [<<"some-id","","message-here">>])..

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

4 participants