2

I'm trying to use Named Pipes with the new thread pool API. My code works most of the time but I'm getting intermittent invalid parameter exception when call StartThreadpoolIo. I've verified that the TP_IO hasn't been closed, and the handle is valid; so I'm at a loss as to what's going wrong.

Does anyone know what other conditions cause an invalid parameter exception?

Queueless
  • 113
  • 1
  • 7

1 Answers1

0

Well, since I didn't get any input on this, I changed the implementation to used the event in the OVERLAPPED struct and used TP_WAIT instead.

There was a bug in this implementation, when you use overlapped io, all calls to read and write should be overlapped. The examples I found online would use a synchronous ReadFile to finish reading the contents of a message, which is wrong.

I now believe that this synchronous read, that was in the TP_IO based implementation, was the cause of the exception; but I can't confirm that.

Queueless
  • 113
  • 1
  • 7