socket_set_timeout DOES NOT work for sockets created with socket_create or socket_accept. Use socket_set_option instead.