Skip to content

Protocol: robust messaging#206

Merged
jakinyele merged 1 commit intoJHUISI:devfrom
EDVTAZ:protocol_fix
Mar 4, 2019
Merged

Protocol: robust messaging#206
jakinyele merged 1 commit intoJHUISI:devfrom
EDVTAZ:protocol_fix

Conversation

@EDVTAZ
Copy link
Copy Markdown
Contributor

@EDVTAZ EDVTAZ commented Mar 3, 2019

Prepend messages with their length before sending them, this way we can
receive them correctly, even if they get fragmented.

Signed-off-by: Gabor Szekely szvgabor@gmail.com

Prepend messages with their length before sending them, this way we can
receive them correctly, even if they get fragmented.

Signed-off-by: Gabor Szekely <szvgabor@gmail.com>
@EDVTAZ
Copy link
Copy Markdown
Contributor Author

EDVTAZ commented Mar 3, 2019

Hi,
when sending long messages, sometimes not all of the message arrived. As far as I can tell, this is due to TCP packet fragmentation (https://stackoverflow.com/questions/756765/when-will-a-tcp-network-packet-be-fragmented-at-the-application-layer). One way of fixing this is prepending the message with it's length, and then receiving exactly that much bytes.

@jakinyele jakinyele merged commit 0cc0a70 into JHUISI:dev Mar 4, 2019
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

Successfully merging this pull request may close these issues.

2 participants