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\$
7
  • \$\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\$ Commented Feb 13, 2020 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\$ Commented Feb 13, 2020 at 12:58
  • \$\begingroup\$ Cool. Did that solve your problem, or is there still a step you need help with? \$\endgroup\$ Commented Feb 13, 2020 at 12:58
  • \$\begingroup\$ yes sending like that above solved the problem \$\endgroup\$ Commented Feb 13, 2020 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\$ Commented Feb 13, 2020 at 13:00

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.