void TSocket::close() {
if (socket_ != -1) {
#ifdef _WIN32
shutdown(socket_, SD_BOTH);
::closesocket(socket_);
#else
shutdown(socket_, SHUT_RDWR);
::close(socket_);
#endif
}
socket_ = -1;
}
客户端连接的套接字在这里进行了关闭
/**
* Wraps a transport into a buffered one.
*
*/
class TBufferedTransportFactory : public TTransportFactory {
public:
TBufferedTransportFactory() {}
virtual ~TBufferedTransportFactory() {}
/**
* Wraps the transport into a buffered one.
*/
virtual boost::shared_ptr<TTransport> getTransport(boost::shared_ptr<TTransport> trans) {
return boost::shared_ptr<TTransport>(new TBufferedTransport(trans));
}
};
原创文章,作者:3628473679,如若转载,请注明出处:https://blog.ytso.com/194805.html