LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 07-28-2009, 02:39 AM   #1
laginagesh
Member
 
Registered: Jul 2009
Posts: 42

Rep: Reputation: 16
Exclamation 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.
 
Old 07-28-2009, 05:10 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to reuse DSN using session or cookies ? raiux Programming 1 08-06-2008 11:22 PM
Socket reuse ed.poore Programming 5 02-14-2007 04:42 PM
disallow password reuse cambie Linux - Security 0 11-29-2004 01:47 PM
reuse Makefile on different .c? chunlee Linux - Newbie 0 11-06-2004 07:48 PM
Cannot reuse CD-RW after first burn lansman Linux - Newbie 2 11-15-2003 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration