Message board for the users of flat assembler.
> Windows > WSAIoctl, DisconnectEx, WSAID_DISCONNECTEX
need help regarding this,
base on closesocket function in MSDN page,
Paul Sheer wrote:
i attempt to follow his advice because closesocket doesn't seem to work in my case, idk why.
DisconnectEx must be retrieved from WSAIoctl.
#define IOC_WS2 0x08000000 #define IOC_OUT 0x40000000 #define IOC_IN 0x80000000 #define IOC_INOUT (IOC_IN | IOC_OUT) #define _WSAIORW( p1, p2 ) (IOC_INOUT | (p1) | (p2)) #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW( IOC_WS2, 6 )
so, i build the following
IOC_WS2 = 0x08000000 IOC_OUT = 0x40000000 IOC_IN = 0x80000000 IOC_INOUT = IOC_IN or IOC_OUT mov eax,IOC_INOUT or eax,IOC_WS2 or eax,6 invoke WSAIoctl,[sock],eax,
now i am stuck, because the third param for WSAIoctl is DWORD LPVOID lpvInBuffer, suppose to be value of WSAID_DISCONNECTEX is kinda weird.
how am i suppose to define WSAID_DISCONNECTEX ?
WSAID_DISCONNECTEX dd 0x7FDA2E11 dw 0x8630,0x436F db 0xA0,0x31,0xF5,0x36,0xA6,0xEE,0xC1,0x57
|07 Feb 2013, 04:46||
just want to say,
i tested the following, and it seems work,
for the socket that after you accept and you want to close them immediately, (reach pool limit or concurrent license limit or any other limit)
WSAAsyncSelect( FD_CLOSE )
SendMessage to [hwnd] WM_SOCK, just accepted socket value, AL=FD_CLOSE
at FD_CLOSE event
problem solved =) so far, i see all further incoming sockets close gracefully.
|18 Feb 2013, 20:40||
< Last Thread | Next Thread >
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.