introduce timeout for socket connection, no longer fragile