Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Net/TFTP/TFTP_DataAck.cpp

Go to the documentation of this file.
00001 #ifndef __J2K__TFTP_DataAck_CPP__
00002 #define __J2K__TFTP_DataAck_CPP__
00003 
00004 #include <j2k/Net/TFTP/TFTP_DataAck.hpp>
00005 
00006 TFTP_DataAck::TFTP_DataAck( ULONG blk )  // , Basic_PThread()
00007  : packet( NULL )
00008 {
00009   blockNo = blk;
00010    
00011   //  Basic_PThread::start();
00012 }
00013 
00014 void TFTP_DataAck::run() 
00015 {
00016   option.rwlock6_wait_queue.write();
00017   option.waitingAck_queue->setFirst();
00018   long rc = 0;
00019   while ( rc >= 0 ) {
00020 
00021     // Not Found = -1, Empty = -50, Invalid = -100 - position
00022     rc = option.waitingAck_queue->findID( blockNo );
00023     if ( rc >= 0 ) {
00024       packet = NULL;
00025       packet = option.waitingAck_queue->remove();
00026       //      option.windowsizeLeft++;
00027       if ( packet != NULL ) delete packet;
00028       packet = NULL;
00029     }
00030   }
00031 
00032   option.rwlock6_wait_queue.releaseWrite();
00033 
00034   // Thread loop exited anyway.
00035 }
00036 
00037 TFTP_DataAck::~TFTP_DataAck() 
00038 {
00039   if ( this == NULL ) return;
00040   if ( packet != NULL )  delete packet;
00041 }
00042 
00043 #endif

Generated on Sun Oct 14 18:46:34 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001