ElephantIO / elephant.io

Send events to a socket.io server through PHP
https://elephantio.github.io/elephant.io/
MIT License
108 stars 34 forks source link

Question: How can I receive packets when I don't know the content? #17

Closed afeno closed 6 months ago

afeno commented 6 months ago

Hello,

I am new with websockets/IOSockets. I have a bit on experience using IOSockets in Node and Python but I need to use php as a IOSocket client and elephant.io seems to be what I am looking for.

The question that I have is about how to receive messages when I don't know the content. (any message) $client->wait('blablabla') will wait until "blablabla" is receveid but how can I get ANY messages and then check what the message is?

Should I use drainfor that? Is that correct?

Thank you!

tohenk commented 6 months ago

Yes, you can use drain().

afeno commented 6 months ago

Thanks!