Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 07-04-2005, 06:20 AM   #1
LQ Newbie
Registered: Jul 2005
Posts: 1

Rep: Reputation: 0
Talking socket programming


I am writing a server, and because it is going to be used in distributed enviornment, it should be robus. SO i am trying to
incorporate all error handling in it. I am encountering following problems.



#1 read from server;

#2 read from terminal(take input)

#3 write to the server;




#4 write to the client;

#5 read from the client;


scenario is like this:
a) client is blocked in line #2. server is blocked in line #5.and suddenly client crashes(ctrl+c). As expected server reads
EOF from the socket, but continue to operate (plz dont ask why, i want to have SIGPIPE in write only). It continues to write
without error first time(because upto this time only FIN has arrived to this socket), and even continues to read from the client(line #5,it is returning 0,its ok). no problem upto this point.
now again when server wants to write to the socket(line#4), it recieves SIGPIPE and process exits.(no problem, because
according to stevens- an attempt to write on the socket, which has recieved RST , will cause SIGPIPE).

but real problem start now- Above scenario is when i am running server and client both on local system. If i try to run server and client in 2 distantly separated systems, server continues to write 8-10 times on the socket, even after getting FIN on the socket.

i think, RST packet that is sent by the closed client( when attempted to write into it), is taking time to reach to the servera
nd because server didn't recieve RST, it continues to write to the socket, irrespective of the fact that it has closed.

can any one plz tell something about the solution.


Old 07-05-2005, 03:31 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
Old 07-05-2005, 05:02 PM   #3
Senior Member
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
what programming language were you thinking of useing. Sorry i dont reconize the code you have here.


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 me ... about Socket programming.. rajsun Programming 2 04-24-2005 05:50 PM
socket programming???? harbir Linux - Networking 2 07-05-2004 03:52 AM
want help in socket programming valib4u *BSD 2 09-12-2003 12:17 AM
Socket Programming cxel91a Programming 4 03-19-2003 11:05 AM
socket programming herambshembekar Programming 3 04-13-2002 04:13 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:26 PM.

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