DDVSocket edits
This commit is contained in:
parent
7ef4d086ff
commit
548e6aab95
2 changed files with 5 additions and 1 deletions
|
@ -88,7 +88,11 @@ bool DDV_write(void * buffer, int todo, int sock){
|
|||
|
||||
bool DDV_ready(int sock){
|
||||
char tmp;
|
||||
int preflags = fcntl(sock, F_GETFL, 0);
|
||||
int postflags = preflags | O_NONBLOCK;
|
||||
fcntl(sock, F_SETFL, postflags);
|
||||
int r = recv(sock, &tmp, 1, MSG_PEEK);
|
||||
fcntl(sock, F_SETFL, preflags);
|
||||
return (r == 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue