Wait for socket connection