Closed PhilLehmann closed 1 year ago
Basically, only the types for the first parameters of the following three methods were missing. When I add them locally in file workerman\workerman\Protocols\ProtocolInterface.php
, it works fine:
interface ProtocolInterface
{
/**
* Check the integrity of the package.
* Please return the length of package.
* If length is unknow please return 0 that mean wating more data.
* If the package has something wrong please return false the connection will be closed.
*
* @param string $recv_buffer
* @param ConnectionInterface $connection
* @return int|false
*/
public static function input(string $recv_buffer, ConnectionInterface $connection);
/**
* Decode package and emit onMessage($message) callback, $message is the result that decode returned.
*
* @param string $recv_buffer
* @param ConnectionInterface $connection
* @return mixed
*/
public static function decode(string $recv_buffer, ConnectionInterface $connection);
/**
* Encode package brefore sending to client.
*
* @param mixed $data
* @param ConnectionInterface $connection
* @return string
*/
public static function encode(mixed $data, ConnectionInterface $connection);
}
Hello together,
after starting my phpsocket.io-implementation ("workerman/phpsocket.io": "1.1.17" and "workerman/phpsocket.io-emitter": "1.0.2"), I receive the following output as soon as I try to connect with a call to (
io('http://localhost:2020');
using"socket.io-client": "2.5.0"
) :In a little bit more readable format:
Am I doing something wrong? To be honest it just looks like a book that everyone should stumble upon.