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

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Fri Jan 11 18:24:10 CST 2008


Hi Steve,

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

Specifically, see Chapters 6 and 7 in C++NPv2 <www.cs.wustl.edu/~schmidt/C++NP/book2/>!

thanks,

        Doug

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


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



More information about the Ace-users mailing list