orca-zhang / influxdb-cpp

💜 C++ client for InfluxDB.
MIT License
163 stars 83 forks source link

Socket Timeout #33

Closed peterchen25 closed 2 years ago

peterchen25 commented 3 years ago

Socket timeouts are not set, therefore the connect could get stuck in case of bad ip or drop of network connection. Suggestion: After creating the socket

struct timeval timeout{TIMEOUT_S,TIMEOUT_US};
setsockopt (sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout,sizeof(timeout));
orca-zhang commented 2 years ago

40 maybe solved this problem