Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

Transmitted packet payloads sometimes replaced with previous payloads using SslStreamTcpSession #76

Closed
berdon opened this issue Nov 14, 2017 · 4 comments

Comments

@berdon
Copy link
Contributor

berdon commented Nov 14, 2017

Taken from kerryjiang/WebSocket4Net#115

First, I can only reproduce this when using wss:// and only at high packet transmission (ie. spinning up 128 packets to be sent at the same time).

I have the following code:

Trace.WriteLine(message);
var payload = Encoding.UTF8.GetBytes(message);
_internalWebSocket.Send(payload, 0, payload.Length);

The trace output shows the expected message below where X ranges from 1-128:

{"Id":"13"}
{"Id":"14"}
{"Id":"12"}
{"Id":"8"}
{"Id":"10"}
{"Id":"16"}
{"Id":"9"}
{"Id":"19"}
...

However, Fiddler decrypting the SSL traffic shows duplicate packets not matching the traced statements:

{"Id":"13"}
{"Id":"14"} x24
{"Id":"30"} x23
{"Id":"18"} x6
{"Id":"21"}
{"Id":"69"}
{"Id":"20"}
{"Id":"17"}
{"Id":"71"}
{"Id":"72"}
{"Id":"70"} x3
{"Id":"77"}
{"Id":"15"}
{"Id":"78"} x13
{"Id":"86"}
{"Id":"73"} x2
{"Id":"94"} x2
{"Id":"96"} x43
{"Id":"112"}
{"Id":"79"}
berdon pushed a commit to berdon/SuperSocket.ClientEngine that referenced this issue Nov 14, 2017
- A single packet was sent in place of numerous queued packets
- Bug existed because the iterator wasn't being used

kerryjiang#76
@berdon
Copy link
Contributor Author

berdon commented Nov 14, 2017

The bug is pretty straight forward - the initial position in the queued packets sent in the SslStreamTcpSession was being used instead of the loop iterator.

kerryjiang pushed a commit that referenced this issue Nov 20, 2017
- A single packet was sent in place of numerous queued packets
- Bug existed because the iterator wasn't being used

#76
@kerryjiang
Copy link
Owner

Realsed a new version:
WebSocket4Net 0.15.1
https://www.nuget.org/packages/WebSocket4Net/0.15.1

@berdon
Copy link
Contributor Author

berdon commented Dec 2, 2017

Sorry about not closing this yet - I've been meaning to get updated to the package and rerun out tests. I'll do this Monday.

@berdon
Copy link
Contributor Author

berdon commented Dec 4, 2017

I've ran our tests with the updated WebSocket4Net 0.15.1 and it looks good. Thanks!

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

No branches or pull requests

2 participants