Fix windows sock recv, optimize memory some