LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-21-2005, 07:30 AM   #1
himanshu
LQ Newbie
 
Registered: Apr 2005
Posts: 2

Rep: Reputation: 0
Post problem with client-server


I have implemented client-server programming using TCP sockets.read and write works fine between client and server but when i close client with ctrl-c then server stops with broken pipe.what may be the problem. I have implemented server using select() system call.how can i check client is no more connected and server is still running and again it will wait for client ???
 
Old 04-21-2005, 07:44 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Moved to Programming because I think you'll have better luck there.
 
Old 04-21-2005, 08:34 AM   #3
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
When a client disconnects, select() will place that descriptor in the readset. I imagine that after select() returns you loop through the descriptors and read from the ones that are left in the readset. When you read from the descriptor that disconnected, read() will return 0.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
HELP - NIS server/client problem sti2envy Linux - Networking 2 09-23-2008 09:10 AM
Client/Server connection problem James_dean Programming 7 09-28-2005 08:31 PM
Tcp/ip Client Server Problem tushar123 Programming 2 03-31-2004 05:16 PM
Refresh client user list at autentication client/server network. robertoneto123 Linux - Networking 0 11-11-2003 10:38 AM
W2K Server and Linux/Win98 Client problem gurkha Linux - Networking 3 06-24-2003 10:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:22 PM.

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