If the operation is asynchronous, ConnectNamedPipe returns immediately. If the operation is still pending, the return value is zero and GetLastError returns ERROR_IO_PENDING.
如果你使用的是异步,ConnectNamedPipe会立即返回,如果没有客户链接,返回0值,用GetLastError返回ERROR_IO_PENDING.
(You can use the HasOverlappedIoCompleted macro to determine when the operation has finished.) If the function fails, the return value is zero and
GetLastError returns a value other than ERROR_IO_PENDING or ERROR_PIPE_CONNECTED.
你可以用HasOverlappedIoCompleted这个宏,区确定操作是否结束
大约意思就是,你用的异步操作,如果没有客户链接,就一直会返回ERROR_IO_PENDING