NetEase/libpomelo — pull request #22 by eminom (2013-06-05 05:40:19+00:00)
Title: Bug fixed: Close socket in pc_transport_t when connection fails.

I found another bug in libpomelo, described as follows:
As I tested reconnecting to server(the server is off-line on purpose. or there is no such server to connect. ) dozens of times, the programs stopped and warned 'libuv24, can not create kqueue'. After googling I doubt if there are sockets which are not closed properly.

As viewed under linux, there are indeed sockets unclosed after failing connecting to server.
There is another state for pc_transport_t: PC_TP_ST_CONNECTING, which is missing from the declared states.

When connection callback is made, the "pc_transport_destroy" can recognize this state and close the socket properly.