add response timeout for a socket connection

This is used to set response timeout for a socket connection.
Scenario: if a remote server is down, when client tries to connect with server, it can set a maximum response time to stop keep waiting for the response. Like if the socket does not open within 5 secs, timeoutexception will throw