-
Notifications
You must be signed in to change notification settings - Fork 123
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
🐛 [Bug]: Can't close websocket connection #698
Comments
@mstrYoda Any idea what may be causing this? |
Hi, you can not close a hijacked connection in this way. It is basically do nothings. You can just return from the websocket handler function and it closes underlying connection after exiting handler. |
Returning directly from the websocket handler worked. |
I am facing the same issue here. Even after i closed the *Conn. The postman client still holds the connection and can send messages to server. I am pooling my socket connections in cache and then writing to it, So returning from the function is practically not possible for me. Your assistance in this matter is highly appreciated |
@dev-tathkarah @mxgnus-de what is the return of the function ? is it returning an error ? |
maybe releated to fasthttp/websocket#39 |
@ReneWerner87 Close() is returning nil and i perform some cleanup activites like clearing the socket connection from cache. But the underlying connection is not closed I was expecting the websocket to behave in a way that when we call conn.Close() then the connection will be closed including whatever the connections holds under the hood should be terminated but the connection still remains in the client and client can still send the message into socket |
Bug Description
I want to close a websocket connection but nothing happens (no error etc.).
The client remains connected and can also send messages.
How to Reproduce
Steps to reproduce the behavior:
Expected Behavior
The server should close the connection after 5 seconds
Contrib package Version
websocket/v1.1.0
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: