cesanta/mongoose — pull request #352 by ranzhengyuan (2014-03-19 14:44:21+00:00)
Title: I think that the socket is invalid, the return should be -1.

For the return value
0: to tell the caller none connection exist;
the positive number: to tell the caller the connection number
the negative number: to tell the caller some error for the server