varspool / Wrench

A simple PHP WebSocket implementation for PHP 7.1
Do What The F*ck You Want To Public License
596 stars 210 forks source link

Errors on close connection #18

Closed Martin17 closed 12 years ago

Martin17 commented 12 years ago

Hi, If I close the connection in this way:

//var ws = new WebSocket('ws://10.150.10.150:8000/chat'); // WebSocket Client on Safari & Chrome
ws.send('close');

everything works as expected, but if I close this way:

ws.close();

I get the following error:

debug: Wrench\ConnectionManager: Wrench\Connection: 10.150.10.214:57853 (060db9ec24f6e7c68aad8f3b8181c6748f15092d891b8f8e724f76f07e8075a6f62a396a332542901943ed6ea3bf93c9cd4899af225670e3a3fb31d056ff5af1): Handling payload: 
warning: Wrench\ConnectionManager: Error on client socket: exception 'Wrench\Exception\ConnectionException' with message 'Unhandled payload type' in /home/desarrollos/sig2/library/Wrench/Connection.php:363
Stack trace:
#0 /home/library/Wrench/Connection.php(307): Wrench\Connection->handlePayload(Object(Wrench\Payload\HybiPayload))
#1 /home/library/Wrench/Connection.php(184): Wrench\Connection->handle('??rtj[')
#2 /home/library/Wrench/Connection.php(413): Wrench\Connection->onData('??rtj[')
#3 /home/library/Wrench/ConnectionManager.php(245): Wrench\Connection->process()
#4 /home/library/Wrench/ConnectionManager.php(172): Wrench\ConnectionManager->processClientSocket(Resource id #34)
#5 /home/library/Wrench/Server.php(200): Wrench\ConnectionManager->selectAndProcess()
#6 /home/application/run.php(86): Wrench\Server->run()
#7 {main}
dominics commented 12 years ago

Fixed in ec3da239db4ec54fb6d2f7fe8547851ce5cbdd25