DDVSocket edits

This commit is contained in:
Thulinma 2010-11-08 15:56:43 +01:00
parent 71a5bf4ea6
commit 8c6a315dfb

View file

@ -55,8 +55,14 @@ int DDV_Listen(int port){
}
}
int DDV_Accept(int sock){
return accept(sock, 0, 0);
int DDV_Accept(int sock, bool nonblock = false){
int r = accept(sock, 0, 0);
if ((r > 0) && nonblock){
int flags = fcntl(r, F_GETFL, 0);
flags |= O_NONBLOCK;
fcntl(r, F_SETFL, flags);
}
return r;
}
bool DDV_write(void * buffer, int todo, int sock){