freedomjs/freedom-for-chrome — pull request #13 by iislucas (2014-06-18 09:08:11+00:00)
Title: Some tcp-socket cleaning up

Summary:
* Better handling of closing
* Improved names of some internal functions
* Simplified read-loop and promise usage
* Give correct errors when they happen
* Correctly stop the accept loop when closed
* Code 'NONE' used for when there is not an error (instead of always saying there is an error)
* No printing of pointless warnings for each internal socket number
* Use early return style rather than else-statements

Fixes: https://github.com/freedomjs/freedom-for-chrome/issues/12

Tested: used with socks-rtc and tested using telnet to the localhost echo-server running in the chrome app.