Feature to enable asynchronous event driven of network events
replace 111 error code literal with ERRNO_CODES.ECONNREFUSED as prompted by juj
Improve callback mechanism to allow an arbitrary userData pointer to be passed during callback registration that will subsequently be passed to the callback
Improve error handling on getsockopt when a level other than SOL_SOCKET or an optname other than SO_ERROR is supplied as per the conversation with juj
Make debug message for the default logging on error handler use Module.printErr rather than Module.print as suggested by juj
Add some more documentation to emscripten.h to explain that the JavaScript error callback takes an array containing the file descriptor, error code and error message.
Modify server on error to be consistent with the client on error
Merge pull request #2390 from fadams/add-network-callbacks

Feature to enable asynchronous event driven network event handling