sockets - Could ConnectEx with SetFileCompletionNotificationModes return synchronously? -


in msdn page of connectex() api, there nothing setfilecompletionnotificationmodes() , if setting flag file_skip_completion_port_on_success work connectex().

the msdn page of setfilecompletionnotificationmodes() states if flag file_skip_completion_port_on_success set, (all ?) apis should return error_io_pending may return immediately, without queueing overlapped in iocp loop.

so, question is: apply of apis takes overlapped , return error_io_pending?

i set socket file_skip_completion_port_on_success before connecting socket calling connectex().

should expect immediate return connectex() (that is, doesn't return error_io_pending , i/o completion totally skipped iocp loop, e.g. maybe when connection localhost)?

even if set file_skip_completion_port_on_success after connectex() completed, (e.g. set in iocp completion routine of connectex()), if disconnect , reuse socket new connection calling connectex() again, set flag before connectex(), same question arise.

why care? assuming can't mean need have special case 1 api call. assuming can mean code calls connectex() should code calls other overlapped apis, wsarecv(), wsasend(), etc. given nature of existing documentation should assume can. therefore, it's correct write code doesn't have special case...

i expect in situations real networking stack it's unlikely you'd ever sync return connectex(), however, if install kind of custom diagnostic winsock provider mocked out connections you, or if invents network layer can connect may possible.

in opinion don't need know answer question, need write code should written given documentation (which says complete synchronously) , fact it's code people expect have written anyway if they'd looked @ of other code calls other overlapped apis.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -