Add ability to set socket timeouts

Add ability to configure socket timeouts. Setting this timeout will
affect reads, writes and the initial connection.