Hi,
I have created an I/O target from a socket but when I send an I/O request to
it, it won't timeout.
The socket was created with WSASocket passing WSA_FLAG_OVERLAPPED and I used
setsockopt() to set read/write timeout as below. After setting these options
the I/O target is created using
IWDFFileHandleTargetFactory::CreateFileHandleTarget.
When I send down the request I specify a timeout of 10 seconds, but it won't
work.
Socket creation:
socket =
WSASocket(AF_INET,SOCK_STREAM,IPPROTO_TCP,NULL,0,WSA_FLAG_OVERLAPPED);
Socket configuration:
int iOptVal = 3000;
res = setsockopt(socket, SOL_SOCKET, SO_SNDTIMEO, (char*)&iOptVal,
sizeof(iOptVal));
res = setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, (char*)&iOptVal,
sizeof(iOptVal));
I/O Target creation:
IWDFFileHandleTargetFactory *fileHandleTargetFactory = NULL;
IWDFIoTarget *target = NULL;
hr = fxDevice->QueryInterface(IID_PPV_ARGS(&fileHandleTargetFactory));
hr = fileHandleTargetFactory->CreateFileHandleTarget(socket, &target);
fileHandleTargetFactory->Release();
Request forwarding:
request->Send(target,WDF_REQUEST_SEND_OPTION_TIMEOUT,-100000000);
Has anyone had this problem? How can I set a timeout for a request sent to
an I/O target created from a socket handle?
Thanks in advance.