Advertisement Jump to content
Sign in to follow this  

Question about ConnectEx in IOCP.

This topic is 4999 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

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, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!