日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux udt 源码,UDT linux下关闭链接耗时过长

發布時間:2023/12/14 linux 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux udt 源码,UDT linux下关闭链接耗时过长 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

不知道使用UDT的人多不多,很大可能會石沉大海啊

=========================================================

我在使用UDT庫的時候,linux下正常關閉一個連接耗時要300ms,Windows下耗時只要十幾毫秒,跟蹤到代碼是在core.cpp中的

void CUDT::close()

{

if (!m_bOpened)

return;

if (0 != m_Linger.l_onoff)

{

uint64_t entertime = CTimer::getTime();

// 就是這個while循環耗時很長

while (!m_bBroken && m_bConnected && (m_pSndBuffer->getCurrBufSize() > 0) && (CTimer::getTime() - entertime < m_Linger.l_linger * 1000000ULL))

{

// linger has been checked by previous close() call and has expired

if (m_ullLingerExpiration >= entertime)

break;

if (!m_bSynSending)

{

// if this socket enables asynchronous sending, return immediately and let GC to close it later

if (0 == m_ullLingerExpiration)

m_ullLingerExpiration = entertime + m_Linger.l_linger * 1000000ULL;

return;

}

#ifndef WIN32

timespec ts;

ts.tv_sec = 0;

ts.tv_nsec = 1000000;

nanosleep(&ts, NULL);

#else

Sleep(1);

#endif

}

}

.................................

}

===================================================================

有沒有對UDT協議熟悉的好友幫忙看看

總結

以上是生活随笔為你收集整理的linux udt 源码,UDT linux下关闭链接耗时过长的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。