Why is my website connection getting closed when I receive large json messages?

I am developing a Windows Phone 8 application using websocket from websocket4net. I am sending a json message and I received a message with a list of objects from the service. When this list is larger (it contains more objects, so the length is longer - more than 18157 characters) I get the first 18157 characters of the message and the connection is closed. And of course the json message is invalid due to its incomplete.

I'm pretty sure the problem is with the big post. I tried to send another json and it sent back another message which is also big. Same problem - I get an error and the connection is closed.

Do you have any idea what to do to get the full message and the connection stays open. The developer of the service says that his service works great.

Thank you in advance:)

+3


source to share


1 answer


websockets handle binary data more efficiently than json text, so if you are sending arrays as binaries it might help, also sometimes I first send a json message telling the recipient how many discrete messages I am sending so that the recipient knows. when it got all the msgs then you can slice the monster json into tag chunks



+1


source







All Articles