[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

socket Select api problem.




   Dear all,


   I'm fighting with a problem with the select() command in a socket
   connection.


   The Select always return with rc=1 even if there is nothing to read.


   See the code below witch is involving the socket.


   What is wrong on this?




   Greetings



   Hendrik Kroon



   Ps. Code also in attachment


   D TCP             S             10I 0

   D RC              S             10I 0

   C                   MOVE      PRTNUM        $H05N0

   C                   EVAL      TCP = TCP_conn(IPADDR:

   C                                            $H05N0)


   C                   eval      tv_len =
   %size(timeval)

   C                   alloc     tv_len
   tv

   C                   eval      p_timeval =
   tv

   C                   eval      tv_sec =
   10

   C                   eval      tv_usec =
   500000

   C                   callp
   FD_ZERO(readset)

   C                   callp     FD_SET(TCP:
   readset)

    * call
   select.

   C                   eval      rc = select(TCP+1:
   %addr(readset):

   c                                    *NULL:
   *NULL:

   c
   p_timeval)




   In this case, even if there is nothing to read on the socket the
   program immediately returns with rc=1

   --
   No virus found in this outgoing message.
   Checked by AVG Free Edition.
   Version: 7.1.408 / Virus Database: 268.13.2/471 - Release Date:
   10/10/2006
 D TCP             S             10I 0         
D RC              S             10I 0  
C                   MOVE      PRTNUM        $H05N0    
C                   EVAL      TCP = TCP_conn(IPADDR:  
C                                            $H05N0)  

C                   eval      tv_len = %size(timeval)                   
C                   alloc     tv_len        tv                          
C                   eval      p_timeval = tv                            
C                   eval      tv_sec = 10                               
C                   eval      tv_usec = 500000                          
C                   callp     FD_ZERO(readset)                          
C                   callp     FD_SET(TCP: readset)                      
 * call select.                                                         
C                   eval      rc = select(TCP+1: %addr(readset):        
c                                    *NULL: *NULL:                      
c                                    p_timeval)                         



In this case, even if there is nothing to read on the socket the program immediately returns with rc=1
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------