The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-20-2008
swap007 swap007 is offline
Registered User
 

Join Date: Oct 2007
Posts: 4
yaaa I m using select call b4 doing read on socket .
so the code is somewhat like this

//thread 1

==========================================
int retval = select(.....)//Now the thread is blocked and it will be awaked whn something is thr to read from socket.


if(retval == -1)
cout<<"error"<<endl;
else
int numBytes = read(sockid,buf,SIZE);
============================================

is dis fine ????
Reply With Quote