//public CSndQueue() //{ // //m_WorkerThread(), // //m_pSndUList(null), // //m_pChannel(null), // //m_pTimer(null), // //m_WindowLock(), // //m_WindowCond(), // //m_bClosing(false), // //m_ExitCond() // m_WindowLock = new Mutex(); // m_WindowCond = new AutoResetEvent(false); // m_ExitCond = new AutoResetEvent(false); //} public CSndQueue(CChannel c, CClock t) { m_WindowLock = new Mutex(); m_WindowCond = new AutoResetEvent(false); m_ExitCond = new AutoResetEvent(false); init(c, t); }
// 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(CChannel c, CClock t) { m_pChannel = c; m_pTimer = t; m_pSndUList = new CSndUList(); m_pSndUList.m_pWindowLock = m_WindowLock; m_pSndUList.m_pWindowCond = m_WindowCond; m_pSndUList.m_pTimer = m_pTimer; DWORD threadID; m_WorkerThread = CreateThread(null, 0, CSndQueue.worker, this, 0, out threadID); if (null == m_WorkerThread) throw new CUDTException(3, 1, -1); }
// 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. public void init(int qsize, int payload, AddressFamily version, int hsize, CChannel[] cc, CClock[] t) { m_iPayloadSize = payload; m_UnitQueue.init(qsize, payload, version); m_pHash = new CHash(); m_pChannel = cc; m_pTimer = t; m_pRcvUList = new CRcvUList(); m_pRendezvousQueue = new CRendezvousQueue(); //DWORD threadID; //m_WorkerThread = CreateThread(null, 0, CRcvQueue.worker, this, 0, &threadID); m_WorkerThread = new Thread(QRcvQueue.worker); m_WorkerThread.Start(this); if (null == m_WorkerThread) throw new CUDTException(3, 1); }