sacOO7 / socketcluster-client-go

GO client for socketcluster
https://socketcluster.io/
Apache License 2.0
55 stars 20 forks source link

Recieving json bigger 512 symbols #4

Closed failhell closed 6 years ago

failhell commented 6 years ago

Not working with received JSON bigger than 512 symbols. In function utils.DeserializeData, json.Unmarshal throws error - unexpected end of JSON input - and return nil. That happened because the resulting json is not complete and the second part comes with the next message.

sacOO7 commented 6 years ago

HI @failhell, I will take a look into it.

sacOO7 commented 6 years ago

I think problem seems to be in the event based websocket library that I am currently using. I am going to write gorilla websocket based event websocket library myself. I will fix that issue in there soon. Thank you for pointing error out :+1:

failhell commented 6 years ago

Yes, gorilla is better variant for now. I'll wait for updates. Thanks.

sacOO7 commented 6 years ago

HI @failhell , I will be updating library with latest implementation of https://github.com/sacOO7/GoWebsocket. Let me know if you have any other issues :+1:

kchaliki commented 6 years ago

Hello @sacOO7 I am having the same issue, I tried your branch but instead of getting a panic due to the failed unmarshall (by the way you are ignoring the error there) it now seems to not do much at all and soon I get a recv: {"event":"#disconnect","data":{"code":4005}}. Is the branch somewhat stable or really just WIP?

sacOO7 commented 6 years ago

@failhell @kchaliki Will be pushing update regarding fix with gorilla integration. Please keep watch on this repo.

sacOO7 commented 6 years ago

Hi @failhell @kchaliki , Just integrated latest gowebsocket integration PR. Can you try updating to latest version of socketcluster client go. I think there won't be any more issues related to json. Please feel free to point out more issues.

kchaliki commented 6 years ago

Thanks @sacOO7 , I will test it shortly and let you know

sacOO7 commented 6 years ago

Thanks @kchaliki , please let me know about it :)

kchaliki commented 6 years ago

Ok I've run my example and it definitely looks better, large messages coming through without any panics. I'll let you know if I hit any other issues as the project takes some shape.

sacOO7 commented 6 years ago

Since problem is resolved now, I will be closing the issue 👍 . Please open new issue if you face problem with library :)