make sure there's a timeout set up in the socket

Signed-off-by: Tomas Neme <lacrymology@gmail.com>
kill connection if timeout

Signed-off-by: Tomas Neme <lacrymology@gmail.com>
test the timeout function

Signed-off-by: Tomas Neme <lacrymology@gmail.com>