Comments (8)
How can we reproduce that?
from php-push-websocket.
For me it happens when:
Run your code in the verbose mode.
Add another client (eg. 3).
Close some tab (eg. 2) in the web browser.
Wait a moment.
I'm using:
openSUSE Tumblewed 20160117
php-fpm 5.6.17 (cli)
from php-push-websocket.
@srchea did you reproduce it?
from php-push-websocket.
I think I haven't window.onbeforeunload
, so it works, but how about Performing action: �
and receiving data from client after quit?
[2016-04-05 02:30:57] Send 'Client ID: 570369a70e990' to client #570369a70e990
[2016-04-05 02:30:57] Finding the socket that associated to the client...
[2016-04-05 02:30:57] Client found
[2016-04-05 02:30:57] Receiving data from the client #570369a4e4a62
[2016-04-05 02:30:57] Performing action: quit
[2016-04-05 02:30:57] Killing a child process
[2016-04-05 02:30:57] Process 14502 is killed!
[2016-04-05 02:30:57] Finding the socket that associated to the client...
[2016-04-05 02:30:57] Client found
[2016-04-05 02:30:57] Receiving data from the client #570369a4e4a62
[2016-04-05 02:30:57] Performing action: �
[2016-04-05 02:31:03] Send 'Client ID: 570369a70e990' to client #570369a70e990
[2016-04-05 02:31:08] Send 'Client ID: 570369a70e990' to client #570369a70e990
[2016-04-05 02:31:18] Send 'Client ID: 570369a70e990' to client #570369a70e990
[2016-04-05 02:31:27] Send 'Client ID: 570369a70e990' to client #570369a70e990
[2016-04-05 02:31:37] Send 'Client ID: 570369a70e990' to client #570369a70e990
[2016-04-05 02:31:43] Send 'Client ID: 570369a70e990' to client #570369a70e990
[2016-04-05 02:31:52] Send 'Client ID: 570369a70e990' to client #570369a70e990
[2016-04-05 02:31:57] Finding the socket that associated to the client...
[2016-04-05 02:31:57] Client found
[2016-04-05 02:31:57] Receiving data from the client #570369a4e4a62
[2016-04-05 02:31:57] Disconnecting client #570369a4e4a62
[2016-04-05 02:31:57] Socket closed
[2016-04-05 02:31:57] Client #570369a4e4a62 disconnected
I added disconnect
if action is quit
:
if ($action == "exit" || $action == "quit") {
//...
$this->disconnect($client);
And now:
[2016-04-05 02:39:58] Finding the socket that associated to the client...
[2016-04-05 02:39:58] Client found
[2016-04-05 02:39:58] Receiving data from the client #57036bc2e484b
[2016-04-05 02:39:58] Performing action: quit
[2016-04-05 02:39:58] Killing a child process
[2016-04-05 02:39:58] Process 14614 is killed!
[2016-04-05 02:39:58] Disconnecting client #57036bc2e484b
[2016-04-05 02:39:58] Socket closed
[2016-04-05 02:39:58] Client #57036bc2e484b disconnected
Is it good?
from php-push-websocket.
@mruz Nope, I wasn't able to reproduce it. :( Yes, when you close a tab, the client sends a 'quit' action: ws.send('quit');
to the WebSocket server!
from php-push-websocket.
Still broken pipe
. Maybe window.onbeforeunload
not cover all exits?
ErrorException[2]: socket_write(): unable to write to socket [32]: Broken pipe
ErrorException[2]: socket_write(): unable to write to socket [104]: Connection reset by peer
on line
if (socket_write($client->getSocket(), $text, strlen($text)) === false) {
ErrorException[2]: socket_shutdown(): unable to shutdown socket [107]: Transport endpoint is not connected
on line
socket_shutdown($client->getSocket(), 2);
from php-push-websocket.
I'll check :)
from php-push-websocket.
Thanks, maybe we can check socket_last_error()
before socket_write()
?
from php-push-websocket.
Related Issues (14)
- bug when chars>125 HOT 1
- Connection Refused HOT 1
- How to send client msg?
- NGINX integration? HOT 1
- Windows 10 Pro composer install error HOT 2
- I have "The client doesn't support WebSocket" HOT 1
- Is it possible that you do not use `pcntl_fork` and use else? HOT 2
- Problem when sending large text HOT 2
- Error when browser refresh HOT 2
- Example client.php HOT 1
- telnet HOT 2
- pcntl_fork() HOT 1
- Client accessing via https HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-push-websocket.