Advertisement

AcceptEx with WSASend and WSARecv :: Winsock

Started by September 26, 2003 09:15 AM
2 comments, last by kuphryn 21 years, 4 months ago
Hi, I am designing a winsock applications that utilizes AcceptEx() winsock extension. According to MSDN, sockets that are accepted via AcceptEx() work only with send(), recv() and other functions. However, they do not work with WSASend() and WSARecv(). Is there a solution to AcceptEx() working with WSASend() and WSARecv()? I want to make sure there is no other alternative. One reason I prefer to use the winsock 2 API is because of the OVERLAPPED I/O feature. Secondly, I the application runs under IOCP. I have never used send() and recv() with IOCP. Thanks, Kuphryn
I don''t know what you''re talking about. What section of the documentation makes you think that you can''t use WSASend or WSARecv on sockets accepted with AcceptEx? I don''t see any mention or reference to that limitation.
Advertisement
> However, they do not work with WSASend() and WSARecv()

That''s because it''s an extension that is not part of the core socket system (MSWSOCK.DLL instead of WS2_32.DLL); they instead interface with the file system.

> One reason I prefer to use the winsock 2 API is because of the OVERLAPPED I/O feature.
> Secondly, I the application runs under IOCP.

There is nothing wrong with using ReadFile and WriteFile on sockets. They both handle overlapped and IOCP. Also, instead of using AcceptEx directly, it is recommended to get a pointer to the required functions through WSAIoctl( SIO_GET_EXTENSION_FUNCTION_POINTER ).

-cb
Correct.

I was discussing theory behing AcceptEx() in general.

Kuphryn

This topic is closed to new replies.

Advertisement