Navigation Menu

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 can't write in onopen() #15

Closed
paraboul opened this issue Oct 15, 2016 · 1 comment
Closed

WebSocket can't write in onopen() #15

paraboul opened this issue Oct 15, 2016 · 1 comment
Assignees

Comments

@paraboul
Copy link
Member

paraboul commented Oct 15, 2016

    var server = new WebSocketServer("ws://127.0.0.1:9099/");

    server.onopen = function(client) {
        client.send("foo"); // does not work
    }

    server.onmessage = function(client, ev) {

    }

    server.onclose = function(client) {

    }

If the send() operation is delayed (e.g. setTimeout()), it works as expected.

It's also worth trying using regular Socket().

@paraboul paraboul added this to the ClassMapper merge milestone Oct 15, 2016
@paraboul paraboul self-assigned this Oct 15, 2016
@paraboul
Copy link
Member Author

Fixed by 472e805

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

1 participant