为什么curl_easy_send在网络丢失时不返回超时
why curl_easy_send does't return timeout when network is lost
我写了一个应用程序,比如libcur的sendrecv示例(示例网址是:http://curl.haxx.se/libcurl/c/sendrecv.html)。不同的是,我的应用程序在循环线程中永远重复发送/接收。添加设置其他参数:
code =curl_easy_setopt(m_curl, CURLOPT_NOSIGNAL, 1L);
code =curl_easy_setopt(m_curl, CURLOPT_CONNECTTIMEOUT, 1L);
code =curl_easy_setopt(m_curl, CURLOPT_TCP_NODELAY, 1L);
//code =curl_easy_setopt(m_curl, CURLOPT_TIMEOUT_MS, 200);//200 milli secs
code =curl_easy_setopt(m_curl, CURLOPT_TIMEOUT, 1L);
但是当网络丢失时,例如电缆从网卡接口中拔出。 curl_easy_send总是返回CURLE_OK。这似乎CURLOPT_TIMEOUT没有效果。是否有任何使用错误或其他问题?如果我想知道网络立即丢失,该怎么办。
>CURLOPT_TIMEOUT对curl_easy_send()没有影响。
相关文章:
- 来自 std::list 的迭代器 .end() 按预期返回"0xcdcdcdcdcdcdcdcd"但 .begin()
- 什么时候在C++中返回常量引用是个好主意
- 你能重载对象变量名本身返回的内容吗
- 为什么 Serial.println(<char[]>);返回随机字符?
- C++映射:具有自定义类的运算符[]不起作用(总是返回0)
- 如何获取std::result_of函数的返回类型
- QueryWorkingSet总是返回false
- (C++)分析树以计算返回错误值的简单算术表达式
- 访问者访问变体并返回不同类型时出错
- 如何返回一个类的两个对象相加的结果
- OpenInventor从9.8升级到10.4.2后,GLSL纹理返回零
- lower_bound()返回最后一个元素
- "throw expression code" 1e7 >返回 d 是什么?投掷标准::overflow_error( "too big" ) : d;意味 着?
- 奇怪的(对我来说)返回声明 - 在谷歌上找不到任何关于它的信息
- 如何取消对nullptr的屏蔽,返回正确的对象
- 奇怪的结构&GCC&clang(void*返回类型)
- UDP 套接字 select() 在某些情况下无延迟(超时)返回 1
- Linux 套接字 recv 返回 -1,errno 110 连接超时
- 为什么curl_easy_send在网络丢失时不返回超时
- select()块,而不是返回超时