Is there any difference between using AcceptEx direct call or using function pointer obtained by WSAIoctl.
MSDN doesn’t fully covers this question regarding performance issue and other problems that can be faced using AcceptEx as direct call.
And other question is:
If I have for example 4 listening sockets in my program, do I need to call WSAIoctl for each listening socket and of course store function pointer for every socket? Or it is enough to call it once for any socket and than use with other ones.
Thank in advance.
WSAIoctl. It’s an extension provider that you use for new functions/additions to the winsock functionality, each new windows version usually add a couple of new extensions.
AcceptEx function pointer:
Using the AcceptEx directly binds the application to the Microsoft provider with the need for MSWsock.dll. As for correctness you probably should do it the msdn way and use the functions through the extension.
Just set it up once and use as you would have with the MSWsock-AcceptEx (you will still be using the same thing)
As for speed/performance I would suggest concentrating on the pooling of sockets instead.
Edit:
Should clarify the (msdn) reason for separating – Extensions are Microsoft specific functions that other providers should not be forced to implement.