forestbelton/cotitan — pull request #2 by jgr2 (2012-07-03 02:11:39+00:00)
Title: Minor changes to client network code

If connect fails the loop would just create another socket, it should be closed and then a new one opened. Also getaddrinfo() may fail because of system error, in which case errno should be used instead of the return value.