DDVSocket edits
This commit is contained in:
parent
71a5bf4ea6
commit
8c6a315dfb
1 changed files with 8 additions and 2 deletions
|
@ -55,8 +55,14 @@ int DDV_Listen(int port){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DDV_Accept(int sock){
|
int DDV_Accept(int sock, bool nonblock = false){
|
||||||
return accept(sock, 0, 0);
|
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){
|
bool DDV_write(void * buffer, int todo, int sock){
|
||||||
|
|
Loading…
Add table
Reference in a new issue