LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to reuse FD_CLR value (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-reuse-fd_clr-value-743300/)

laginagesh 07-28-2009 02:39 AM

Client - Server problem
 
Hi,

i have written a Client-Server application.
For new client i am creating client_sockfd

client_sockfd = accept(server_sockfd,
(struct sockaddr*)&client_address,&client_len);
FD_SET(client_sockfd,&readfd);

after receiving data from client i am disconnecting the client
FD_CLR(client_sockfd,&readfd);

after disconnecting if the same client is connecting to server it is getting new client_sockfd...How to reuse the same same client_sockfd for the same client again?

for every connection and disconnection client_sockfd changing,after 1024 iterations the server is closing.

cheers
Nagesh

pixellany 07-28-2009 05:10 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


All times are GMT -5. The time now is 10:40 PM.