2001-10-15 14:34:02 +00:00
|
|
|
#include <sys/types.h>
|
2003-11-06 20:47:59 +00:00
|
|
|
#ifndef __MINGW32__
|
2001-02-05 18:46:11 +00:00
|
|
|
#include <sys/socket.h>
|
2003-11-06 20:47:59 +00:00
|
|
|
#endif
|
|
|
|
#include "windoze.h"
|
2001-02-05 18:46:11 +00:00
|
|
|
#include "socket.h"
|
|
|
|
|
|
|
|
void socket_tryreservein(int s,int size)
|
|
|
|
{
|
|
|
|
while (size >= 1024) {
|
2003-11-06 20:47:59 +00:00
|
|
|
if (winsock2errno(setsockopt(s,SOL_SOCKET,SO_RCVBUF,&size,sizeof size)) == 0) return;
|
2001-02-05 18:46:11 +00:00
|
|
|
size -= (size >> 5);
|
|
|
|
}
|
|
|
|
}
|