Skip to content
Discussion options

You must be logged in to vote

Take a look at: https://deepwiki.com/search/i-would-like-to-understand-how_f38cd8fb-990a-4ec5-871d-a0e5bbd84c3d?mode=fast

TL;DR:

Your socket.send() call executes before the TCP connection is established. In INET, TcpSocket.connect() is asynchronous; you must wait for the socketEstablished callback (or check socket state) before sending data. Receiving requires callbacks, but sending only requires respecting the connection state.

But it's not a problem to call send() before the connection is established. The data would be queued and sent along the ACK packet. The problem is that you close() your connection before the connection is established and in that case, queued data is dropped accord…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@eike
Comment options

@rhornig
Comment options

Answer selected by eike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants