C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 05-07-2003, 08:21 PM   #1
Registered User
 
Join Date: Oct 2002
Posts: 27
broken pipe

I am not sure if this belongs here or in the C board.

I have been writing a simple server program.
When a user connects I create a new thread to handle the user.
There is another program that is used as a client to connect to the server.
The user has the option to disconnect from the server. If the user does so I close out the socket and exit the thread.

But if the user just does ctrl-c to kill the client program then I get an error "Broken Pipe" on the server, and it crashes. I think this has to do with the socket still being open but no one on the other end.

Does anyone know any way to have the server handle the client program being killed with out crashing the server program?

Let me know if It would help for me to post the server code here.
I am writing the program in C, using gcc to compile on a FreeBSD unix machine.
samps005 is offline   Reply With Quote
Old 05-07-2003, 09:04 PM   #2
Registered User
 
Join Date: Oct 2002
Posts: 27
I decided that it would probably help to have the code, so I will attach it here.
Attached Files
File Type: c quote_server.c (7.7 KB, 79 views)
samps005 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cont of IPC using PIPE BMathis C Programming 1 03-15-2009 05:16 PM
Pipe class. eXeCuTeR Linux Programming 8 08-21-2008 03:44 AM
Named pipe problem rahul_c C Programming 3 10-02-2007 05:40 PM
Pipe(): Interprocess or Intraprocess comm? @nthony C Programming 2 03-28-2007 07:27 PM
Pipe the console from a DLL loobian Windows Programming 12 11-30-2003 08:55 PM


All times are GMT -6. The time now is 08:58 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22