fix bugs in TcpTransport