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

Websocket client onconnect supports neither reply nor close #53

Open
lewapkon opened this issue May 17, 2017 · 1 comment
Open

Websocket client onconnect supports neither reply nor close #53

lewapkon opened this issue May 17, 2017 · 1 comment
Assignees
Milestone

Comments

@lewapkon
Copy link

Even though relating to definition it should:

-callback onconnect(websocket_req:req(), state()) ->
    % Simple client: only server-initiated pings will be
    % automatically responded to.
    {ok, state()}
    % Keepalive client: will automatically initiate a ping to the server
    % every keepalive() ms.
    | {ok, state(), keepalive()}
    % Immediately send a message to the server.
    | {reply, websocket_req:frame(), state()}
    % Close the connection.
    | {close, binary(), state()}.

Onconnect supports only {ok, state()} | {ok, state(), keepalive()}.

@sanmiguel
Copy link
Owner

You're absolutely right, that's a horrible inconsistency. Pretty sure the {close, _, _} should be OK to support, but I'm not sure about {reply, _, _} - it might be too early in the protocol to send data. I need to check... Will get back to you when I find something.

@sanmiguel sanmiguel self-assigned this Jun 16, 2017
@sanmiguel sanmiguel added this to the 2.0 milestone Jun 16, 2017
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