Micheal,  

Without seeing your code, it's not really possible to know what your real 
problem(s) is(are).  The scenario you outlined seems reasonable, but that's 
because it doesn't include sufficient detail to say otherwise.  

I think you may be placing too much importance on port numbers and how many 
there are in use.  This may add to your confusion.  

Under normal circumstances, you only ever need to know a single port number, 
ie. the one that you LISTEN on (if you are the server) or the one you CONNECT 
to (if you are a client).  All other ports are ephemeral and you don't need to 
know what they are.  They will be filled in for you by the CONNECT/ACCEPT 
process.  

=== > Date: Tue, 3 Apr 2012 12:01:47 -0400
> From: [email protected]
> Subject: tcp/ip EZASMI concurrent server problem GIVE/TAKESOCET
> To: [email protected]
> 
> Hi,
> 
>  
> 
> I have an assembler concurrent server using the EZASMI interface, I am using
> 4 ports from my IP address 192.168.1.111 I do a socket,bind listen using
> ip,port,socket
> 
> I create four subtasks (ATTACH) to process connection on these 4 ports, I
> pass these task a parameter list of KEY 8 subpool 1 storage by which I will
> communication with them e.g. ECB and socket info
> 
> This is a layout of that storage 
> 
>  
> 
> THREAD_DSECT DSECT                                  
> 
> ECB_ADDR     DS  XL4      FOR SUBTASK TO WAIT FOR WORK
> 
> TASK_ADDR_1  DS  XL4      TCB ADDRESS               
> 
> SOCKET       DS  XL2      ORIGNAL SOCKET OF SERVER          
> 
> SERV_SOCK    DS  XL2      SOCKET CREATE VIA accept API     
> 
> FIN_ECB      DS  XL4                                
> 
> END_ECB      DS  XL4                                
> 
> TIE_DSECT    DS  XL(TIELENTH)  TASK WORK AREA       
> 
>  
> 
>  
> 
> Then I wait…….
> 
>  
> 
> When I get incoming connection via SELECT/ACCEPT I move the low order ½ from
> retocde from the accept call which is the new socket I will be communicating
> to SERV_SOCK so far so good
> 
> (it happens to be a 4). I then do a GIVESOCKET using the SERV_SOCK (4)
> getting a return code 0, 
> 
>  
> 
> I then POST the subtask to execute the TAKESOCKET using the SERV_SOCK  were
> I get errno of X’71’
> 
>  
> 
>     113              EBADF      TAKESOCKET  the socket has already been
> taken       
> 
>  
> 
> Am I doing anything wrong in this scenario
> 
>  
> 
>  
> 
>    Thanks                                                    
> 
>   
> 
>  
> 
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
                                          
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to