We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64f7319 commit f3a4854Copy full SHA for f3a4854
trantor/net/TcpClient.cc
@@ -44,6 +44,8 @@ void removeConnector(const ConnectorPtr &connector)
44
// connector->
45
}
46
47
+TcpClient::IgnoreSigPipe TcpClient::initObj;
48
+
49
static void defaultConnectionCallback(const TcpConnectionPtr &conn)
50
{
51
LOG_TRACE << conn->localAddr().toIpPort() << " -> "
trantor/net/TcpClient.h
@@ -132,6 +132,16 @@ class TcpClient : NonCopyable
132
#ifdef USE_OPENSSL
133
std::shared_ptr<SSL_CTX> _sslCtxPtr;
134
#endif
135
+ class IgnoreSigPipe
136
+ {
137
+ public:
138
+ IgnoreSigPipe()
139
140
+ ::signal(SIGPIPE, SIG_IGN);
141
+ }
142
+ };
143
144
+ static IgnoreSigPipe initObj;
145
};
146
147
} // namespace trantor
0 commit comments