Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientWebSocket truncates large messages. #7

Open
maxima120 opened this issue Nov 2, 2017 · 3 comments
Open

ClientWebSocket truncates large messages. #7

maxima120 opened this issue Nov 2, 2017 · 3 comments

Comments

@maxima120
Copy link

I implemented Snapshot message for realtime client and it is quite large (I guess around 100K) but EndOfMessage becomes true around 60-80K hence I get always a part of it. and there is no way around.

Any help will be appreciated

@sefbkn
Copy link
Owner

sefbkn commented Nov 20, 2017

@maxima120 Do you have any code I can test with, or a stack trace? I'm not aware of any size limitations at the web socket level, so a bit more info would be handy to troubleshoot.

@nsxdavid
Copy link

nsxdavid commented Nov 26, 2017

Easy way to see the issue is to modify the requestString to give level2 data like this:

             var requestString = JsonConvert.SerializeObject(new {
                    type = "subscribe",
                    product_ids = ProductIds,
		    channels = new string[] { "level2" }
                });

Level2 data starts with a big snapshot dump of the order book. Data is eventually jumbled.

@nsxdavid
Copy link

Fix for this is:

await stream.WriteAsync(receiveBuffer.Array, receiveBuffer.Offset, webSocketReceiveResult.Count);

The change is to use the webSocketReicveResult.Count instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants