-
Notifications
You must be signed in to change notification settings - Fork 75
Injecting data at the WebSocket/Node object... #53
Comments
Hello :-), To be frank, I didn't understand your questions. I understand there is 2 questions.
Good \o/!
What “vinculate” means?
This is a PHP related question, and no, it's not possible to change the parent class of an instance. So maybe it is better to expose/explain your workflow instead.
You want to write a helper? Just write a function or a trait to connect a client, send a data and close the client. |
Hello, thanks. Vinculate means assign one system user a one or more node in the servers. For example, if I need send one message at one specific client connected at the system, ex, admin user logged at the laravel system, know wath is yours nodes in the server. Thanks. |
User::id (1) = Node::id (asdasdqwe) |
I have try other things, and in this moment, I have one database table with this relations, and I can get all nodes ID for one client. Now, I want send one message at one node, from my client in php, using websocket/client php library, for example, doing this: $fstck = FSTocken::where('user_id', 1)->first();
$client = new WsClient(
new SClient('tcp://127.0.0.1:8080')
);
$client->connect();
$client->send('Login rendered', *************);
$client->close(); How I can define this line for correct function. The node ID is in Thanks. |
It's that possible? |
How I can connect at one node specific? Thanks. YnievesDotNet |
Hello, I try to understand on IRC but i really need to go to sleep :D (Paris timezone power) So you need to have an identifier in your custom node i assume its the method
You need to test this i write that just for exemple its not probably the solution but maybe a clue |
We also have the |
Injecting data at the WebSocket/Node object
Hello, I try including this library at my project in Laravel. In this moment I can manage the running of server from Laravel using Artisan command, but I need vinculate one or some nodes for each client, when the client connect at the system.
Other things what I need is configure the listeners on one abstract class, but inside the server connection, while it is running.
For example, I need create one class calling HoaWebSocket, and I can configure for example, this:
This is a fictitious idea, is only for comment the flow with I need.
In this moment, I can send the system message at our user using this method
And the idea final is it:
But, doing this action without
Hoa\Websocket\Client
and/orHoa\Socket\Client
.Thanks
YnievesDotNet
The text was updated successfully, but these errors were encountered: