[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
>BTW, we discuss how to work around this in a number of examples in
Specifically, see Chapters 6 and 7 in C++NPv2 <www.cs.wustl.edu/~schmidt/C++NP/book2/>!
>Steve Huston, Riverace Corporation
>Want to take ACE training on YOUR schedule?
>> -----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
>> > 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
>> >In linux, I have codes below:
>> > 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()
>> >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:
>> Take care,
>> Dr. Douglas C. Schmidt Professor and
>> Associate Chair
>> Electrical Engineering and Computer Science TEL: (615) 343-8197
>> Vanderbilt University WEB:
>> Nashville, TN 37203 NET:
>> d.schmidt at vanderbilt.edu
>> ace-users mailing list
>> ace-users at mail.cse.wustl.edu
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