File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -62,13 +62,31 @@ class ThriftClientImpl {
6262 void close ();
6363
6464 // Set the connect timeout
65- void set_conn_timeout (int ms) { _socket->setConnTimeout (ms); }
65+ void set_conn_timeout (int ms) {
66+ if (!_socket) {
67+ LOG (WARNING) << " socket is nullptr" ;
68+ return ;
69+ }
70+ _socket->setConnTimeout (ms);
71+ }
6672
6773 // Set the receive timeout
68- void set_recv_timeout (int ms) { _socket->setRecvTimeout (ms); }
74+ void set_recv_timeout (int ms) {
75+ if (!_socket) {
76+ LOG (WARNING) << " socket is nullptr" ;
77+ return ;
78+ }
79+ _socket->setRecvTimeout (ms);
80+ }
6981
7082 // Set the send timeout
71- void set_send_timeout (int ms) { _socket->setSendTimeout (ms); }
83+ void set_send_timeout (int ms) {
84+ if (!_socket) {
85+ LOG (WARNING) << " socket is nullptr" ;
86+ return ;
87+ }
88+ _socket->setSendTimeout (ms);
89+ }
7290
7391protected:
7492 ThriftClientImpl (const std::string& ipaddress, int port)
You can’t perform that action at this time.
0 commit comments