Jump to content
  • Advertisement
Sign in to follow this  
Johndragon

Question about ConnectEx in IOCP.

This topic is 4846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If i can post a connectex in iocp? the socket is non-blocking and bind to the handle of icop. Can the GetQueued...... function recv a signal?

Share this post


Link to post
Share on other sites
Advertisement
Hello.

First of all, I'm korean. so i cannot write in English as well as you think... sorry

Yes, you can receive information of connection result by Overlapped.

The 7th argument of ConnectEx is LPOVERLAPPED. That means you can use this function for

async works. And can receive the result by GetQueuedCompletionStatus or WSAGetOverlappedResult.

(But I didn't use WSAGetOverlappedResult ^^a)


For example...

typedef struct OverlappedEx : OVERLAPPED
{
DWORD id; // for what?
} OverlappedEx;

OverlappedEx ov;

::memset( &ov, 0, sizeof( ov ) );
ov->id = ( DWORD )this;
ConnectEx( ..., &ov );

...

OverlappedEx* result;

GetQueuedCompletionStatus( ..., &result, ... );
if( result != 0 && result->id != 0 )
( ( AnObjectType* )result->id )->Callback( ... );

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!