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 07-04-2005, 06:20 AM   #1
iiit
LQ Newbie
 
Registered: Jul 2005
Posts: 1

Rep: Reputation: 0
Talking socket programming


hi

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.



client:

loop{

#1 read from server;

#2 read from terminal(take input)

#3 write to the server;

}


server:

loop{

#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.

thanks

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

Rep: Reputation: 64
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
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: LFS-Version SVN-20091202, Arch 2009.08
Posts: 1,496

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


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 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


All times are GMT -5. The time now is 04:45 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration