fix socket error 11: Resource temporarily unavailable