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

The connection is not automatically removed in WebSocketServer when the client is disconnected #163

Open
leolee3914 opened this issue Mar 3, 2021 · 2 comments

Comments

@leolee3914
Copy link

I am using the WebSocketServer. When the client reconnects, the following situations occur:

[2021-03-03 22:33:09][info] Ip "tcp://192.168.31.1:13345" establish connection
[2021-03-03 22:33:10][info] Ip "tcp://192.168.31.1:13347" establish connection
[2021-03-03 22:33:10][info] Ip "tcp://192.168.31.1:13348" establish connection
[2021-03-03 22:33:11][info] Ip "tcp://192.168.31.1:13350" establish connection
[2021-03-03 22:33:11][info] Ip "tcp://192.168.31.1:13351" establish connection
[2021-03-03 22:33:12][info] Ip "tcp://192.168.31.1:13353" establish connection
[2021-03-03 22:33:15][info] Ip "tcp://192.168.31.1:13357" establish connection
[2021-03-03 22:33:16][info] Ip "tcp://192.168.31.1:13359" establish connection

WebSocketServer::onDisconnect() is not called.

$socketStream->on('end', function () use($connection) {

When I changed to $socketStream->on('close', Closure);, the connection is automatically closed:

[2021-03-03 22:35:12][info] Ip "tcp://192.168.31.1:45664" establish connection
[2021-03-03 22:35:17][info] Ip "tcp://192.168.31.1:45664" left connection
[2021-03-03 22:35:17][info] Ip "tcp://192.168.31.1:45674" establish connection
[2021-03-03 22:35:18][info] Ip "tcp://192.168.31.1:45674" left connection
[2021-03-03 22:35:18][info] Ip "tcp://192.168.31.1:45678" establish connection
[2021-03-03 22:35:18][info] Ip "tcp://192.168.31.1:45678" left connection
[2021-03-03 22:35:18][info] Ip "tcp://192.168.31.1:45680" establish connection
[2021-03-03 22:35:19][info] Ip "tcp://192.168.31.1:45680" left connection
[2021-03-03 22:35:19][info] Ip "tcp://192.168.31.1:45682" establish connection
[2021-03-03 22:35:20][info] Ip "tcp://192.168.31.1:45682" left connection
[2021-03-03 22:35:20][info] Ip "tcp://192.168.31.1:45684" establish connection

Sorry for my bad English

@leolee3914
Copy link
Author

It seems that it is related:

$this->stream->once('end', function() {

@Nek-
Copy link
Member

Nek- commented Apr 27, 2021

Hello, thank you for your concern.

But as specified in the readme, the maintenance is discontinued on this library. Unless you have a fix for it it will stay in this state.

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

2 participants