question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

client.close() does not wait for packets to be flushed

See original GitHub issue

Steps to reproduce :

  1. Build a packet and use queueAndFlush to flush it
  2. Close right after
  3. See the client not receiving the packet because the connection got closed before.

Pseudocode:

Packet packet = Packet.builder().putInt(100).putInt(200);
packet.queueAndFlush(client);
client.close();

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jhg023commented, Sep 24, 2020

@Antideveloppeur Thanks for opening this issue. I’ll look into it very soon to see if I can manage to reproduce it myself, and then fix the issue (if one exists).

0reactions
jhg023commented, Nov 21, 2020

I’ll be happy to reopen this issue if you can provide code that reproduces this issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client doesn't acknowledge when server closes the connection
close() is called, the closing handshake starts (client sends the FIN packet), and waits until the peer acknowledges (also sends FIN) and closes ......
Read more >
close() socket directly after send(): unsafe? - Stack Overflow
It depends upon the implementation, but in general, yes, a close() will flush any data remaining in the buffer before it actually tears...
Read more >
WiFi Client - No socket available even with client.flush(), client ...
flush() removes only the current packet characters from the socket. By the time you call client.stop(), the socket may already have characters ...
Read more >
This is strictly a violation of the TCP specification
This means the socket is waiting for the application to execute close() . A socket can be in CLOSE_WAIT state indefinitely until the...
Read more >
TCP Client/Server Communication | Caché I/O Device Guide
UDP is not connection-based; each transmission of data packets is an independent event. ... Closing the client side first is preferable. If the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found