0
\$\begingroup\$

I have integrated WebSocketSharp with Unity 2018.4.14f1 and it works well with Android and IOS. I wanted to know that most of the other socket.io plugins for unity have a wrapper of Class Packet over the top which binds and sends packetID, EventType along with Data.

My question is, do we need to write such a wrapper for WebSocketSharp also in Unity?

\$\endgroup\$
  • \$\begingroup\$ Have you tried using it without such a wrapper? Did you encounter a specific snag or problem along the way that we can help you solve? \$\endgroup\$ – DMGregory Feb 13 '20 at 4:55
  • \$\begingroup\$ the data that i was trying to send was not getting sent to the server..i had to bind my data like this { "42":["test",{"name":"jack", "age":32}] } where 42 is packet id. test is the event callback. and rest is data. \$\endgroup\$ – user135890 Feb 13 '20 at 12:58
  • \$\begingroup\$ Cool. Did that solve your problem, or is there still a step you need help with? \$\endgroup\$ – DMGregory Feb 13 '20 at 12:58
  • \$\begingroup\$ yes sending like that above solved the problem \$\endgroup\$ – user135890 Feb 13 '20 at 13:00
  • \$\begingroup\$ so i wanted to know do i need to make a wrapper class Packet to bind data like that for WebSocketSharp \$\endgroup\$ – user135890 Feb 13 '20 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.