fixed the socket timeout and buffer stream