fix compiler warnings
add support for connection timeout
based on https://github.com/square/SocketRocket/pull/131