replace by recv using flag of MSG_PEEK to fix the socket can not disconnect timely