[Ace-users] Why send() cause a SIGPIPE rather than returning -1 with ECONNRESET
qqq
yuanhp_china at hotmail.com
Fri Jan 11 12:16:22 CST 2008
My problem occurs in linux socket API. I am not sure whether it occurs
in 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? Any help are appreciated.
Hua
More information about the Ace-users
mailing list