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
Last edited by laginagesh; 07-28-2009 at 04:51 AM.
|