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

Onion examples - websockets: close websocket? #268

Open
alexe100 opened this issue Apr 8, 2020 · 0 comments
Open

Onion examples - websockets: close websocket? #268

alexe100 opened this issue Apr 8, 2020 · 0 comments

Comments

@alexe100
Copy link

alexe100 commented Apr 8, 2020

Hi
I am trying onions' websocket example using the "Simple Websocket Client" firefox extension as client. It works. It can connect, send information but when I close connection on client side some seconds later I see this on server:

"GET /" 101 0 (Keep-Alive)
[ERROR websockets.c:68] Error reading data: 9: Bad file descriptor (255)

If we test the contents of the data_ready_len argument we realize that it has value -1. Hence, -1 means websocket closed, right?

In that case we should close the socket on server side, right?

How to close the socket that is passed by argument?
close() does not work.

onion_connection_status websocket_example_cont(void *data, onion_websocket * ws, ssize_t data_ready_len)
{
...
}

Thanks a lot

@alexe100 alexe100 changed the title Onion examples - websckets: close websocket? Onion examples - websockets: close websocket? Apr 8, 2020
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