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));
}
};
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。