Comments (8)
Resolved this issue by changing findByConnection function in
vendor\codemash\laravel-socket\src\Clients.php
:
public function findByConnection($connection) {
return $this->first(function ($client, $key) use ($connection) {
return $client->connection === $connection;
});
}
but need this change in resitory too
from laravel-socket.
Can you give me more information about the issue, stacktrace in your config?
from laravel-socket.
Laravel 5.4
[2017-03-03 21:53:51] debug.ERROR: ErrorException: Trying to get property of non-object in C:\xampp\htdocs\newton\vendor\codemash\laravel-socket\src\Clients.php:17
Stack trace:
#0 C:\xampp\htdocs\newton\vendor\codemash\laravel-socket\src\Clients.php(17): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', 'C:\xampp\htdocs...', 17, Array)
#1 [internal function]: Codemash\Socket\Clients->Codemash\Socket{closure}(Object(Codemash\Socket\Client), 622)
#2 C:\xampp\htdocs\newton\vendor\laravel\framework\src\Illuminate\Support\Arr.php(147): call_user_func(Object(Closure), Object(Codemash\Socket\Client), 622)
#3 C:\xampp\htdocs\newton\vendor\laravel\framework\src\Illuminate\Support\Collection.php(425): Illuminate\Support\Arr::first(Array, Object(Closure), NULL)
#4 C:\xampp\htdocs\newton\vendor\codemash\laravel-socket\src\Clients.php(18): Illuminate\Support\Collection->first(Object(Closure))
#5 C:\xampp\htdocs\newton\vendor\codemash\laravel-socket\src\MessageComponent.php(69): Codemash\Socket\Clients->findByConnection(Object(Ratchet\WebSocket\Version\RFC6455\Connection))
#6 C:\xampp\htdocs\newton\vendor\cboden\ratchet\src\Ratchet\WebSocket\Version\RFC6455.php(204): Codemash\Socket\MessageComponent->onMessage(Object(Ratchet\WebSocket\Version\RFC6455\Connection), '{"command":"sen...')
#7 C:\xampp\htdocs\newton\vendor\cboden\ratchet\src\Ratchet\WebSocket\WsServer.php(96): Ratchet\WebSocket\Version\RFC6455->onMessage(Object(Ratchet\WebSocket\Version\RFC6455\Connection), '\x81\xAEu\\xD5d\x0E~\xB6\v\x181\xB4\n\x11...')
#8 C:\xampp\htdocs\newton\vendor\cboden\ratchet\src\Ratchet\Http\HttpServer.php(53): Ratchet\WebSocket\WsServer->onMessage(Object(Ratchet\Server\IoConnection), '\x81\xAEu\\xD5d\x0E~\xB6\v\x181\xB4\n\x11...')
#9 C:\xampp\htdocs\newton\vendor\cboden\ratchet\src\Ratchet\Server\IoServer.php(113): Ratchet\Http\HttpServer->onMessage(Object(Ratchet\Server\IoConnection), '\x81\xAEu\\xD5d\x0E~\xB6\v\x181\xB4\n\x11...')
#10 [internal function]: Ratchet\Server\IoServer->handleData('\x81\xAEu\\xD5d\x0E~\xB6\v\x181\xB4\n\x11...', Object(React\Socket\Connection))
#11 C:\xampp\htdocs\newton\vendor\evenement\evenement\src\Evenement\EventEmitterTrait.php(64): call_user_func_array(Array, Array)
#12 C:\xampp\htdocs\newton\vendor\react\stream\src\Stream.php(173): Evenement\EventEmitter->emit('data', Array)
#13 [internal function]: React\Stream\Stream->handleData(Resource id #622, Object(React\EventLoop\StreamSelectLoop))
#14 C:\xampp\htdocs\newton\vendor\react\event-loop\src\StreamSelectLoop.php(232): call_user_func(Array, Resource id #622, Object(React\EventLoop\StreamSelectLoop))
#15 C:\xampp\htdocs\newton\vendor\react\event-loop\src\StreamSelectLoop.php(201): React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)
#16 C:\xampp\htdocs\newton\vendor\cboden\ratchet\src\Ratchet\Server\IoServer.php(85): React\EventLoop\StreamSelectLoop->run()
#17 C:\xampp\htdocs\newton\vendor\codemash\laravel-socket\src\Server.php(65): Ratchet\Server\IoServer->run()
#18 C:\xampp\htdocs\newton\vendor\codemash\laravel-socket\src\Commands\Listen.php(41): Codemash\Socket\Server->run()
#19 [internal function]: Codemash\Socket\Commands\Listen->handle()
#20 C:\xampp\htdocs\newton\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(28): call_user_func_array(Array, Array)
#21 C:\xampp\htdocs\newton\vendor\laravel\framework\src\Illuminate\Support\helpers.php(912): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#22 C:\xampp\htdocs\newton\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(86): value(Object(Closure))
#23 C:\xampp\htdocs\newton\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(30): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#24 C:\xampp\htdocs\newton\vendor\laravel\framework\src\Illuminate\Container\Container.php(524): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#25 C:\xampp\htdocs\newton\vendor\laravel\framework\src\Illuminate\Console\Command.php(182): Illuminate\Container\Container->call(Array)
#26 C:\xampp\htdocs\newton\vendor\symfony\console\Command\Command.php(262): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#27 C:\xampp\htdocs\newton\vendor\laravel\framework\src\Illuminate\Console\Command.php(167): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#28 C:\xampp\htdocs\newton\vendor\symfony\console\Application.php(826): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 C:\xampp\htdocs\newton\vendor\symfony\console\Application.php(189): Symfony\Component\Console\Application->doRunCommand(Object(Codemash\Socket\Commands\Listen), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 C:\xampp\htdocs\newton\vendor\symfony\console\Application.php(120): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 C:\xampp\htdocs\newton\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(123): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 C:\xampp\htdocs\newton\artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 {main}
from laravel-socket.
I have not yet checked support for Laravel 5.4 but it "should" be compatible. I'll try and replicate your issue as soon as I can (probably tomorrow). Meanwhile, feel free to explore the issue.
from laravel-socket.
if i could help more:
this is the object $this received on findByConnection on clients.php
{"622":{"id":622,"connection":{},"ip":"127.0.0.1","session_manager":{"session":{}}}}
and this is the objecto from $connection in the same file
{}
from laravel-socket.
i think i solved the error, on laravel 5.4 the signature for Collection::first is
($value,$key), you have on your Clients.php ($key,$value)
from laravel-socket.
You're correct, this is a change introduced in 5.3. Can you verify this is a fix? I'll run a few tests tomorrow to make sure the change is a valid fix.
from laravel-socket.
I am having the same issue.....
from laravel-socket.
Related Issues (9)
- When disconnected, isConnected() still is true.
- Does not work with Laravel 5.7 HOT 1
- keeping the alive connection
- Example fail(after changing findByConnection function)
- conflict installations
- can not getUser from client connection
- Send message to all clients from server
- Clients Not Connecting To Socket On Production Server
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 laravel-socket.