#Socket-io-v2 WebGL

1 messages Β· Page 1 of 1 (latest)

wind flame
terse wadi
#

Hi, there is no demo available. What implementation / library are you using on the server side?

Also are you using any "special" features - I mean namespaces, binary messages, ...?

wind flame
#

Yes, namespaces. Is there a workaround for this lack of functionality in this asset?

terse wadi
#

not without major code changes unfortunately. This is one of the reasons, why the V4 PLUS asset has a completely new code base

#

(its a complete rewrite)

wind flame
#

In this matrix I see that basic namspaces are present.
Btw I need soketIo v2 because our Be uses v2

terse wadi
#

basic namespaces?

To be clear: Only emits sent on the default namespace (/) work. Any other namespace is not possible without code changes

#

Please do not mix up namespaces and the "path"

#

.../socket.io/ is the path - "/" is the namespace used if no namespace is explicitely specified (namespaces: https://socket.io/docs/v2/namespaces/ )

A Namespace is a communication channel that allows you to split the logic of your application over a single shared connection.

wind flame
#

Ohh. Probably we dont use namespaces. πŸ™‚

#

Anyway I have already bought this asset and I will try it tomorrow. πŸ™‚

terse wadi
#

Got no experience with Java and socket.io at all and no reports yet, too. From the first look, the library looks quite full featured and okay.

I'd love to hear your results. If you struggling, ask away, if it's just a small change required, I'll be happy to help - Just major rewrites are out of scope πŸ™‚

wind flame
#

Hi again πŸ™‚
I am in the half way of implementation, and looks promising.
however, could you please tell me, what could be a reason for an error: "Disconnected transport error"?

I am trying to implement like in example (which works fine), but this error occurs in the beginning after connecting.

wind flame
#

Hi @terse wadi
Please don't bother with previous question.
Instead, could you please tell me, why in Unity Editor it works fine, but in the WebGL build changing address doesn't occur?
I have checkboxes: auto-connect and reconnect disabled, and doing Connect after changing address. Is there any additional step for WebGL? It seems that in WebGL build it somehow 'remembers' addres from inspector on the prefab.
_socketClient.socketIOAddress = "myApp-dev.company.pl/socket.io?auth-token=" + _authorizationToken; _socketClient.Instance.Connect();

wind flame
#

In browser console I can see 'Connecting SIO to ..." happens before my address change and my Connect() (both marked in red with Debug.LogError())

wind flame
#

Let say I somehow changed address in runtime - but two clients can't receive socket messages (it works in Unity Editor, on two different computers, but doesn't work in browser with WebGL).
I have log: object SocketClient(Clone) does not have receiver for function RaiseSIOEvent!

terse wadi
wind flame
#

yes

#

I think it is something wrong with my implementation, but please give a hint πŸ™‚

terse wadi
#

Can you please send a screenshot of the component in the inspector when you got this connections issue? (you can remove the address)

#

just want to make sure we have the same settings

wind flame
#

yes, but how can I paste screenshot here?

terse wadi
#

you should be able to do so (now πŸ˜„ ).

wind flame
terse wadi
#

is this log in the background made with our original code? Or did you already change the asset code here?

wind flame
#

I just used/implemented your asset in our application. Source code is not modified

terse wadi
#

perfect

#

So I got this situation, right?

  • You are changing the serverAddress field of the SocketIOCommunicator before calling Connect()
  • On Native build (or Editor) it is working
  • On WebGL it is not working - and according to the logs it tried to connect before "Connect()"
wind flame
#

yes, exactly

terse wadi
#

okay. Let me check this real quick

#

I can confirm this is a bug

wind flame
#

you were able to reproduce this?

terse wadi
#

better: I already found the issue in the code. I just have to elaborate how to fix it πŸ˜„

#

that part is a bit tricky

wind flame
#

πŸ˜€

terse wadi
#

could you kindly open a ticket by mailing [email protected] ?
No need for long explainations, just copy my summary from above into the body and add your asset store invoice ID to verify the purchase.

I will then send a fixed version as soon as I got it done πŸ™‚

wind flame
#

yes, sure, thank you very much πŸ™‚

terse wadi
#

The lack of functionality in the v2 protocol does not make it too easy πŸ˜„

I am trying to backport the "new" Connect methods from our v3/v4 asset to keep it consistent