1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Merge pull request #82 from subramanivmk/ioctl_linux

ioctlsocket() is Windows-Only. Using ioctl() for non-Windows platform.
This commit is contained in:
Brian Fiete 2020-03-12 06:29:42 -07:00 committed by GitHub
commit a18b51f1e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,8 +164,13 @@ namespace System.Net
[CLink, StdCall]
static extern HSocket accept(HSocket s, SockAddr* addr, int32* addrLen);
#if BF_PLATFORM_WINDOWS
[CLink, StdCall]
static extern int32 ioctlsocket(HSocket s, int cmd, int* argp);
#else
[CLink, StdCall]
static extern int32 ioctl(HSocket s, int cmd, int* argp);
#endif
[CLink, StdCall]
static extern int32 select(int nfds, FDSet* readFDS, FDSet* writeFDS, FDSet* exceptFDS, TimeVal* timeVal);
@ -221,7 +226,12 @@ namespace System.Net
mHandle = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
int param = 1;
#if BF_PLATFORM_WINDOWS
ioctlsocket(mHandle, FIONBIO, &param);
#else
ioctl(mHandle, FIONBIO, &param);
#endif
if (mHandle == INVALID_SOCKET)
{
#unwarn
@ -270,7 +280,12 @@ namespace System.Net
return .Err;
int param = 1;
#if BF_PLATFORM_WINDOWS
ioctlsocket(mHandle, FIONBIO, &param);
#else
ioctl(mHandle, FIONBIO, &param);
#endif
if (mHandle == INVALID_SOCKET)
{
#unwarn