hashicorp/yamux — pull request #2 by evanphx (2014-06-11 16:21:28+00:00)
Title: Use type checking to detect an errant closure

Inspired by http://twitter.com/jessemcnelis/status/476704848486731776 I decided to figure out a way to check for the socket closure without comparing strings.

It's a bit longer, but it's more correct.

Side note: I'm thinking maybe about moving this function to a separate package because this is such a common issue.