Skip to content

Fix #1430 by detecting case when client connect/disconnects before me…#1442

Merged
mattrjacobs merged 1 commit intoNetflix:masterfrom
mattrjacobs:fix-1430
Dec 14, 2016
Merged

Fix #1430 by detecting case when client connect/disconnects before me…#1442
mattrjacobs merged 1 commit intoNetflix:masterfrom
mattrjacobs:fix-1430

Conversation

@mattrjacobs
Copy link
Contributor

…trics start getting emitted

@mattrjacobs mattrjacobs merged commit 11ca011 into Netflix:master Dec 14, 2016
@mattrjacobs mattrjacobs deleted the fix-1430 branch December 14, 2016 22:52
writer.print("ping: \n\n");
// explicitly check for client disconnect - PrintWriter does not throw exceptions
if (writer.checkError()) {
throw new IOException("io error");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid the cost of creating and throwing the exception, can you call moreDataWillBeSent.set(false); instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants