Timeout not infinite for client reads after sending
This commit is contained in:
parent
48a055a061
commit
8da5bf1ae5
3 changed files with 7 additions and 2 deletions
|
@ -78,6 +78,10 @@ void Socket::stopReadWait(){
|
|||
}
|
||||
|
||||
std::wstring Socket::read() {
|
||||
return read(INFINITE);
|
||||
}
|
||||
|
||||
std::wstring Socket::read(int timeout){
|
||||
wchar_t buf[BUFSIZE];
|
||||
int result;
|
||||
DWORD cbBytesRead = 0;
|
||||
|
@ -91,7 +95,7 @@ std::wstring Socket::read() {
|
|||
|
||||
ReadFile( d->hPipe, &buf, sizeof(wchar_t)*BUFSIZE, &cbBytesRead, &oOverlap);
|
||||
|
||||
result = WaitForSingleObject(oOverlap.hEvent, INFINITE);
|
||||
result = WaitForSingleObject(oOverlap.hEvent, timeout);
|
||||
|
||||
if(!d->running){
|
||||
CloseHandle(d->readEvent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue