Core: Socket handling EINTR

git-svn-id: svn://ultimatepp.org/upp/trunk@6804 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-01-21 20:13:34 +00:00
parent d222342920
commit 1ece04ecb7
2 changed files with 3 additions and 4 deletions

View file

@ -388,7 +388,7 @@ bool TcpSocket::Accept(TcpSocket& ls)
socket = accept(ls.GetSOCKET(), NULL, NULL);
if(socket != INVALID_SOCKET)
break;
if(!WouldBlock()) { // In prefork condition, Wait is not enough, as other process can accept
if(!WouldBlock() && GetErrorCode() != SOCKERR(EINTR)) { // In prefork condition, Wait is not enough, as other process can accept
SetSockError("accept");
return false;
}
@ -614,7 +614,7 @@ bool TcpSocket::RawWait(dword flags, int end_time)
FD_SET(socket, fdsetx);
int avail = select((int)socket + 1, fdsetr, fdsetw, fdsetx, tvalp);
LLOG("Wait select avail: " << avail);
if(avail < 0) {
if(avail < 0 && GetErrorCode() != SOCKERR(EINTR)) {
SetSockError("wait");
return false;
}

View file

@ -188,8 +188,7 @@ void SkylarkApp::Run()
IpAddrInfo ipinfo;
ipinfo.Execute(ip, port, IpAddrInfo::FAMILY_IPV4);
// addrinfo *addr = ipinfo.GetResult();
#ifdef _DEBUG
int qq = 0;
for(;;) {