E
ellre923
I use gdb to trace the following code and find "howlong" is changed
strangely.
int CmDispatch::waitFor(timeval* howlong) {
int nfound=-1;
for(;nfound<0 {
CmFdSet& r=onRead_->onSelects();
CmFdSet& w=onWrite_->onSelects();
CmFdSet& e=onExcept_->onSelects();
howlong = queue_->calculateTimeout(howlong);
//print howlong. howlong=0x8083258
//then step into select()
nfound=select(r,w,e,howlong);
if(nfound<0) {handleError();}}
return nfound;}
int CmDispatch::select(CmFdSet& r,CmFdSet& w,CmFdSet& e,timeval*
howlong) {
//print howlong. howlong=0x0
return ::select(nfds_,r,w,e,howlong);}
There is no code between the change of "howlong". Why this happen?
strangely.
int CmDispatch::waitFor(timeval* howlong) {
int nfound=-1;
for(;nfound<0 {
CmFdSet& r=onRead_->onSelects();
CmFdSet& w=onWrite_->onSelects();
CmFdSet& e=onExcept_->onSelects();
howlong = queue_->calculateTimeout(howlong);
//print howlong. howlong=0x8083258
//then step into select()
nfound=select(r,w,e,howlong);
if(nfound<0) {handleError();}}
return nfound;}
int CmDispatch::select(CmFdSet& r,CmFdSet& w,CmFdSet& e,timeval*
howlong) {
//print howlong. howlong=0x0
return ::select(nfds_,r,w,e,howlong);}
There is no code between the change of "howlong". Why this happen?