[Ace-users] [ace-users] Why send() cause a SIGPIPE rather than returning -1with ECONNRESET

Steve Huston shuston at riverace.com
Fri Jan 11 18:12:08 CST 2008


BTW, we discuss how to work around this in a number of examples in
C++NPv2.

-Steve

--
Steve Huston, Riverace Corporation
Want to take ACE training on YOUR schedule?
See http://www.riverace.com/training.htm


> -----Original Message-----
> From: ace-users-bounces at cse.wustl.edu 
> [mailto:ace-users-bounces at cse.wustl.edu] On Behalf Of Douglas 
> C. Schmidt
> Sent: Friday, January 11, 2008 2:36 PM
> To: yuanhp_china at hotmail.com; ace-users at cse.wustl.edu
> Subject: Re: [ace-users] Why send() cause a SIGPIPE rather 
> than returning -1with ECONNRESET
> 
> 
> Hi,
> 
> > My problem occurs in linux socket API.  I am not sure whether it
> > occurs in ACE.
> 
> You are correct - this is a UNIX/Linux socket API issue, not an ACE
> issue.  Please make sure to post these sorts of questions to a
> UNIX/Linux newsgroup, comp.unix.questions, rather than to
> comp.soft-sys.ace.
> 
> >In linux, I have codes below:
> >
> >//client
> >
> > char buf[1024*1024];
> > int n = send(sockfd, buf, 1024*1024, 0);    //the first send()
> > n = send(sockfd, buf, 1024, 0);             //the second send()
> >
> > The first send() should block for a while. If client 
> receives  an RST
> >from server when send() is blocking,  the first send() returns a
> >number less than 1024*1024. However, sometimes the second send()
will
> >cause a SIGPIPE signal or sometimes it return -1 with a ECONNRESET
> >error rather than SIGPIPE.
> >
> > Why? 
> 
> Because that's the way that the semantics of send() are defined.
> Please take a look at a good book or website on the socket API.
> Here's a place to start:
> 
> http://www.retran.com/beej/sendman.html
> 
> Take care,
> 
>      Doug
> -- 
> Dr. Douglas C. Schmidt                       Professor and 
> Associate Chair
> Electrical Engineering and Computer Science  TEL: (615) 343-8197
> Vanderbilt University                        WEB: 
> www.dre.vanderbilt.edu/~schmidt
> Nashville, TN 37203                          NET: 
> d.schmidt at vanderbilt.edu
> 
> _______________________________________________
> ace-users mailing list
> ace-users at mail.cse.wustl.edu
> http://mail.cse.wustl.edu/mailman/listinfo/ace-users
> 




More information about the Ace-users mailing list