fix the bug of publish, server close the connection when timeout.