Hi all,
I’ve written some multithreaded C++ software for a ZEM4310 (USB3.0ss) that receives large amounts of data (length = 32,768 MB) from a block pipe. I call it like this in what is essentially an asynchronous loop:
result = dev_->ReadFromBlockPipeOut(address, 16384, 32768, (unsigned char *)data);
Sometimes this works fine, in which case it takes approximately 800us to receive the data. That is fine. However, after a random number of calls, the function will hang and then return after 10.1s. When it hangs, it always takes 10.1s, so I assume the default timeout time is 10 seconds or so. After it hangs the first time, any subsequent call to ReadFromBlockPipeOut(…) hangs as well, like this
dev_->ReadFromBlockPipeOut(address, 16384, 32768, data); // takes 800us
dev_->ReadFromBlockPipeOut(address, 16384, 32768, data); // takes 800us
dev_->ReadFromBlockPipeOut(address, 16384, 32768, data); // takes 800us
dev_->ReadFromBlockPipeOut(address, 16384, 32768, data); // TIMEOUT: takes 10.1s
dev_->ReadFromBlockPipeOut(address, 16384, 32768, data); // TIMEOUT: takes 10.1s
dev_->ReadFromBlockPipeOut(address, 16384, 32768, data); // TIMEOUT: takes 10.1s
…
…
Can anyone provide any advice on why this is happening? Thanks for your time