亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? queue.h

?? Last Update: Jan 22 2009 可靠UDP傳輸, 一套高效的基于windows平臺的C++ 開發庫
?? H
字號:
/*****************************************************************************Copyright (c) 2001 - 2008, The Board of Trustees of the University of Illinois.All rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions aremet:* Redistributions of source code must retain the above  copyright notice, this list of conditions and the  following disclaimer.* Redistributions in binary form must reproduce the  above copyright notice, this list of conditions  and the following disclaimer in the documentation  and/or other materials provided with the distribution.* Neither the name of the University of Illinois  nor the names of its contributors may be used to  endorse or promote products derived from this  software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "ASIS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ORCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, ORPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDINGNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*****************************************************************************//*****************************************************************************written by   Yunhong Gu, last updated 06/02/2008*****************************************************************************/#ifndef __UDT_QUEUE_H__#define __UDT_QUEUE_H__#include "common.h"#include "packet.h"#include "channel.h"#include <vector>#include <map>class CUDT;struct CUnit{   CPacket m_Packet;		// packet   int m_iFlag;			// 0: free, 1: occupied, 2: msg read but not freed (out-of-order), 3: msg dropped};class CUnitQueue{friend class CRcvQueue;friend class CRcvBuffer;public:   CUnitQueue();   ~CUnitQueue();public:      // Functionality:      //    Initialize the unit queue.      // Parameters:      //    1) [in] size: queue size      //    2) [in] mss: maximum segament size      //    3) [in] version: IP version      // Returned value:      //    0: success, -1: failure.   int init(const int& size, const int& mss, const int& version);      // Functionality:      //    Increase (double) the unit queue size.      // Parameters:      //    None.      // Returned value:      //    0: success, -1: failure.   int increase();      // Functionality:      //    Decrease (halve) the unit queue size.      // Parameters:      //    None.      // Returned value:      //    0: success, -1: failure.   int shrink();      // Functionality:      //    find an available unit for incoming packet.      // Parameters:      //    None.      // Returned value:      //    Pointer to the available unit, NULL if not found.   CUnit* getNextAvailUnit();private:   struct CQEntry   {      CUnit* m_pUnit;		// unit queue      char* m_pBuffer;		// data buffer      int m_iSize;		// size of each queue      CQEntry* m_pNext;   }   *m_pQEntry,			// pointer to the first unit queue   *m_pCurrQueue,		// pointer to the current available queue   *m_pLastQueue;		// pointer to the last unit queue   CUnit* m_pAvailUnit;         // recent available unit   int m_iSize;			// total size of the unit queue, in number of packets   int m_iCount;		// total number of valid packets in the queue   int m_iMSS;			// unit buffer size   int m_iIPversion;		// IP version};struct CSNode{   CUDT* m_pUDT;		// Pointer to the instance of CUDT socket   uint64_t m_llTimeStamp;      // Time Stamp   int m_iHeapLoc;		// location on the heap, -1 means not on the heap};class CSndUList{friend class CSndQueue;public:   CSndUList();   ~CSndUList();public:      // Functionality:      //    Insert a new UDT instance into the list.      // Parameters:      //    1) [in] ts: time stamp: next processing time      //    2) [in] u: pointer to the UDT instance      // Returned value:      //    None.   void insert(const int64_t& ts, const CUDT* u);      // Functionality:      //    Update the timestamp of the UDT instance on the list.      // Parameters:      //    1) [in] u: pointer to the UDT instance      //    2) [in] resechedule: if the timestampe shoudl be rescheduled      // Returned value:      //    None.   void update(const CUDT* u, const bool& reschedule = true);      // Functionality:      //    Retrieve the next packet and peer address from the first entry, and reschedule it in the queue.      // Parameters:      //    0) [out] addr: destination address of the next packet      //    1) [out] pkt: the next packet to be sent      // Returned value:      //    1 if successfully retrieved, -1 if no packet found.   int pop(sockaddr*& addr, CPacket& pkt);      // Functionality:      //    Remove UDT instance from the list.      // Parameters:      //    1) [in] u: pointer to the UDT instance      // Returned value:      //    None.   void remove(const CUDT* u);      // Functionality:      //    Retrieve the next scheduled processing time.      // Parameters:      //    None.      // Returned value:      //    Scheduled processing time of the first UDT socket in the list.   uint64_t getNextProcTime();private:   void insert_(const int64_t& ts, const CUDT* u);   void remove_(const CUDT* u);private:   CSNode** m_pHeap;			// The heap array   int m_iArrayLength;			// physical length of the array   int m_iLastEntry;			// position of last entry on the heap array   pthread_mutex_t m_ListLock;   pthread_mutex_t* m_pWindowLock;   pthread_cond_t* m_pWindowCond;   CTimer* m_pTimer;};struct CRNode{   CUDT* m_pUDT;                // Pointer to the instance of CUDT socket   uint64_t m_llTimeStamp;      // Time Stamp   CRNode* m_pPrev;             // previous link   CRNode* m_pNext;             // next link   bool m_bOnList;              // if the node is already on the list};class CRcvUList{public:   CRcvUList();   ~CRcvUList();public:      // Functionality:      //    Insert a new UDT instance to the list.      // Parameters:      //    1) [in] u: pointer to the UDT instance      // Returned value:      //    None.   void insert(const CUDT* u);      // Functionality:      //    Remove the UDT instance from the list.      // Parameters:      //    1) [in] u: pointer to the UDT instance      // Returned value:      //    None.   void remove(const CUDT* u);      // Functionality:      //    Move the UDT instance to the end of the list, if it already exists; otherwise, do nothing.      // Parameters:      //    1) [in] u: pointer to the UDT instance      // Returned value:      //    None.   void update(const CUDT* u);public:   CRNode* m_pUList;		// the head nodeprivate:   CRNode* m_pLast;		// the last node};class CHash{public:   CHash();   ~CHash();public:      // Functionality:      //    Initialize the hash table.      // Parameters:      //    1) [in] size: hash table size      // Returned value:      //    None.   void init(const int& size);      // Functionality:      //    Look for a UDT instance from the hash table.      // Parameters:      //    1) [in] id: socket ID      // Returned value:      //    Pointer to a UDT instance, or NULL if not found.   CUDT* lookup(const int32_t& id);      // Functionality:      //    Insert an entry to the hash table.      // Parameters:      //    1) [in] id: socket ID      //    2) [in] u: pointer to the UDT instance      // Returned value:      //    None.   void insert(const int32_t& id, const CUDT* u);      // Functionality:      //    Remove an entry from the hash table.      // Parameters:      //    1) [in] id: socket ID      // Returned value:      //    None.   void remove(const int32_t& id);private:   struct CBucket   {      int32_t m_iID;		// Socket ID      CUDT* m_pUDT;		// Socket instance      CBucket* m_pNext;		// next bucket   } **m_pBucket;		// list of buckets (the hash table)   int m_iHashSize;		// size of hash table};class CRendezvousQueue{public:   CRendezvousQueue();   ~CRendezvousQueue();public:   void insert(const UDTSOCKET& id, const int& ipv, const sockaddr* addr);   void remove(const UDTSOCKET& id);   bool retrieve(const sockaddr* addr, UDTSOCKET& id);private:   struct CRL   {      UDTSOCKET m_iID;      int m_iIPversion;      sockaddr* m_pPeerAddr;   };   std::vector<CRL> m_vRendezvousID;         // The sockets currently in rendezvous mode   pthread_mutex_t m_RIDVectorLock;};class CSndQueue{friend class CUDT;friend class CUDTUnited;public:   CSndQueue();   ~CSndQueue();public:      // Functionality:      //    Initialize the sending queue.      // Parameters:      //    1) [in] c: UDP channel to be associated to the queue      //    2) [in] t: Timer      // Returned value:      //    None.   void init(const CChannel* c, const CTimer* t);      // Functionality:      //    Send out a packet to a given address.      // Parameters:      //    1) [in] addr: destination address      //    2) [in] packet: packet to be sent out      // Returned value:      //    Size of data sent out.   int sendto(const sockaddr* addr, CPacket& packet);private:#ifndef WIN32   static void* worker(void* param);#else   static DWORD WINAPI worker(LPVOID param);#endif   pthread_t m_WorkerThread;private:   CSndUList* m_pSndUList;		// List of UDT instances for data sending   CChannel* m_pChannel;                // The UDP channel for data sending   CTimer* m_pTimer;			// Timing facility   pthread_mutex_t m_WindowLock;   pthread_cond_t m_WindowCond;   volatile bool m_bClosing;		// closing the worker   pthread_cond_t m_ExitCond;};class CRcvQueue{friend class CUDT;friend class CUDTUnited;public:   CRcvQueue();   ~CRcvQueue();public:      // Functionality:      //    Initialize the receiving queue.      // Parameters:      //    1) [in] size: queue size      //    2) [in] mss: maximum packet size      //    3) [in] version: IP version      //    4) [in] hsize: hash table size      //    5) [in] c: UDP channel to be associated to the queue      //    6) [in] t: timer      // Returned value:      //    None.   void init(const int& size, const int& payload, const int& version, const int& hsize, const CChannel* c, const CTimer* t);      // Functionality:      //    Read a packet for a specific UDT socket id.      // Parameters:      //    1) [in] id: Socket ID      //    2) [out] packet: received packet      // Returned value:      //    Data size of the packet   int recvfrom(const int32_t& id, CPacket& packet);private:#ifndef WIN32   static void* worker(void* param);#else   static DWORD WINAPI worker(LPVOID param);#endif   pthread_t m_WorkerThread;private:   CUnitQueue m_UnitQueue;		// The received packet queue   CRcvUList* m_pRcvUList;		// List of UDT instances that will read packets from the queue   CHash* m_pHash;			// Hash table for UDT socket looking up   CChannel* m_pChannel;		// UDP channel for receving packets   CTimer* m_pTimer;			// shared timer with the snd queue   int m_iPayloadSize;                  // packet payload size   volatile bool m_bClosing;            // closing the workder   pthread_cond_t m_ExitCond;private:   int setListener(const CUDT* u);   void removeListener(const CUDT* u);   void setNewEntry(CUDT* u);   bool ifNewEntry();   CUDT* getNewEntry();   void storePkt(const int32_t& id, CPacket* pkt);private:   pthread_mutex_t m_LSLock;   volatile CUDT* m_pListener;			// pointer to the (unique, if any) listening UDT entity   CRendezvousQueue* m_pRendezvousQueue;	// The list of sockets in rendezvous mode   std::vector<CUDT*> m_vNewEntry;              // newly added entries, to be inserted   pthread_mutex_t m_IDLock;   std::map<int32_t, CPacket*> m_mBuffer;	// temporary buffer for rendezvous connection request   pthread_mutex_t m_PassLock;   pthread_cond_t m_PassCond;};class CMultiplexer{public:   CSndQueue* m_pSndQueue;	// The sending queue   CRcvQueue* m_pRcvQueue;	// The receiving queue   CChannel* m_pChannel;	// The UDP channel for sending and receiving   CTimer* m_pTimer;		// The timer   int m_iPort;			// The UDP port number of this multiplexer   int m_iIPversion;		// IP version   int m_iMSS;			// Maximum Segment Size   int m_iRefCount;		// number of UDT instances that are associated with this multiplexer   bool m_bReusable;		// if this one can be shared with others};#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久青草欧美一区二区三区| 国产精品美女久久久久aⅴ | 国产精品自产自拍| 亚洲精选免费视频| 精品国产一区a| 欧美亚洲图片小说| 成人美女视频在线观看18| 日本在线不卡视频一二三区| 亚洲日本丝袜连裤袜办公室| 久久亚洲综合av| 欧美日韩精品三区| 91免费看片在线观看| 国产自产视频一区二区三区| 日韩精品欧美精品| 亚洲男同性恋视频| 国产精品入口麻豆九色| 欧美变态tickle挠乳网站| 欧美色爱综合网| 97久久精品人人澡人人爽| 国产高清在线精品| 麻豆成人综合网| 亚洲成人高清在线| 一区二区三区在线观看动漫| 国产精品入口麻豆原神| 久久久99精品免费观看不卡| 日韩免费成人网| 欧美一区二区三区在线观看视频| 91高清视频免费看| 91久久精品网| 色婷婷综合久色| 一本大道av一区二区在线播放 | 91在线观看污| 岛国精品在线观看| 国产91精品在线观看| 国产精品综合久久| 国产成人啪免费观看软件 | 不卡的av电影| 成人精品免费网站| 丰满白嫩尤物一区二区| 蜜桃av噜噜一区| 亚洲午夜影视影院在线观看| 亚洲色图欧洲色图| 日韩欧美中文字幕公布| 欧美不卡视频一区| 日韩情涩欧美日韩视频| 欧美蜜桃一区二区三区| 色婷婷综合久久久久中文一区二区| 成人午夜视频网站| 国产精一区二区三区| 国产一区久久久| 韩国三级电影一区二区| 麻豆成人免费电影| 免费看日韩精品| 免费一级片91| 一区二区欧美国产| 国产精品久久久久久久久果冻传媒 | 欧美色老头old∨ideo| 在线观看成人小视频| 色综合久久综合| 在线观看国产一区二区| 91精品福利在线| 91婷婷韩国欧美一区二区| 日本韩国一区二区| 欧洲亚洲国产日韩| 欧美伦理视频网站| 欧美一级欧美三级| 2020国产精品| 中文一区二区在线观看| 中文欧美字幕免费| 一区二区三区四区中文字幕| 亚洲一区免费观看| 蜜臀av性久久久久蜜臀aⅴ| 免费成人在线网站| 国产精品自拍av| 99久久免费精品| 99久久久久久| 9191久久久久久久久久久| 91精品免费在线| 久久精品日产第一区二区三区高清版 | 亚洲欧美区自拍先锋| 亚洲午夜电影在线观看| 亚洲免费av高清| 热久久一区二区| 国产成人丝袜美腿| 91福利在线免费观看| 一本大道av一区二区在线播放| 欧美乱妇一区二区三区不卡视频| 日韩视频在线一区二区| 国产精品色呦呦| 亚洲va天堂va国产va久| 三级久久三级久久| 国产精品1024| 欧美日韩久久一区| 久久精品夜夜夜夜久久| 夜夜夜精品看看| 狠狠色伊人亚洲综合成人| av亚洲精华国产精华精华| 欧美日韩视频在线第一区 | 日韩精品五月天| 国产一区二区在线视频| 一本久久a久久精品亚洲| 91精品国产品国语在线不卡 | 欧美国产在线观看| 亚洲动漫第一页| 处破女av一区二区| 欧美久久久久久蜜桃| 欧美激情综合网| 视频一区视频二区中文字幕| 日韩精品一级中文字幕精品视频免费观看 | 欧美一区二区视频免费观看| 国产精品妹子av| 蜜臀精品久久久久久蜜臀| 97国产一区二区| 久久免费视频一区| 亚洲少妇最新在线视频| 国内一区二区视频| 欧美丝袜丝交足nylons图片| 中文字幕高清一区| 美女脱光内衣内裤视频久久网站 | av电影天堂一区二区在线观看| 欧美一区二区三区不卡| 亚洲欧美日韩在线| 国产精品亚洲专一区二区三区| 欧美日韩综合色| 国产精品久久久久久久蜜臀| 久久精品国产77777蜜臀| 欧美性大战久久久久久久蜜臀| 中国av一区二区三区| 国内精品免费**视频| 日韩亚洲欧美一区| 亚洲第一综合色| 91网站在线播放| 国产精品看片你懂得| 国产成人在线影院| 日韩美女在线视频| 久久国产免费看| 欧美一区三区四区| 亚洲成年人网站在线观看| 91麻豆免费看片| 亚洲欧洲99久久| 丁香啪啪综合成人亚洲小说 | 亚洲夂夂婷婷色拍ww47| av资源网一区| 中文字幕在线观看不卡| 岛国精品在线播放| 精品国产伦一区二区三区免费| 日韩二区三区在线观看| 欧美日韩国产综合视频在线观看 | 91丝袜呻吟高潮美腿白嫩在线观看| 3atv一区二区三区| 亚洲成人免费在线| 欧美最新大片在线看| 亚洲九九爱视频| 色狠狠综合天天综合综合| 日韩理论片在线| 色综合久久99| 亚洲综合免费观看高清完整版| 91在线你懂得| 亚洲欧美日韩中文播放| 一本久久a久久免费精品不卡| 欧美韩国日本不卡| 成人毛片视频在线观看| 国产精品福利一区二区三区| 99久久精品情趣| 亚洲欧美日本韩国| 欧美日韩亚洲高清一区二区| 一区av在线播放| 在线亚洲人成电影网站色www| 石原莉奈在线亚洲二区| 亚洲精品在线网站| 懂色av一区二区在线播放| 国产精品热久久久久夜色精品三区 | 91久久精品一区二区二区| 亚洲综合免费观看高清完整版| 欧美伦理电影网| 日本欧洲一区二区| 亚洲国产精品传媒在线观看| 91一区一区三区| 午夜视频一区二区| 欧美成人精品高清在线播放| 国产一区二区影院| 综合精品久久久| 欧美美女直播网站| 精品写真视频在线观看| 中文欧美字幕免费| 色狠狠桃花综合| 亚洲电影第三页| 久久精品日产第一区二区三区高清版| av亚洲精华国产精华精| 午夜av区久久| 国产亚洲va综合人人澡精品| 色婷婷久久久亚洲一区二区三区| 视频在线在亚洲| 国产精品久久看| 欧美精品日韩综合在线| www.在线欧美| 久久精品久久综合| 日韩毛片一二三区| 亚洲精品在线免费播放| 日本精品免费观看高清观看|