Bug#489688: While trying to open named pipe to talk to micasad, micasa
client may get an error ERROR_PIPE_BUSY. Client has to retry operation.
This commit is contained in:
parent
1c3769a03d
commit
9327d9b56c
@ -94,23 +94,37 @@ void * ipc_win_create()
|
||||
//#ifdef SSCS_WIN32_PLAT_F
|
||||
// connect to the named Pipe
|
||||
HANDLE hPipe = NULL;
|
||||
int rcode;
|
||||
int rcode = 0, i;
|
||||
DWORD mode = PIPE_READMODE_MESSAGE;
|
||||
|
||||
DbgTrace(1, " -ipc_win_create- start\n", 0);
|
||||
|
||||
hPipe = CreateFile(
|
||||
XTIER_RPC_PIPE,
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
0,
|
||||
NULL, //null,
|
||||
OPEN_EXISTING,
|
||||
0,
|
||||
0);
|
||||
for (i = 0; i < 5; i++) {
|
||||
hPipe = CreateFile(
|
||||
XTIER_RPC_PIPE,
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
0,
|
||||
NULL, //null,
|
||||
OPEN_EXISTING,
|
||||
0,
|
||||
0);
|
||||
|
||||
if (hPipe != INVALID_HANDLE_VALUE)
|
||||
break;
|
||||
|
||||
rcode = GetLastError();
|
||||
|
||||
if (rcode != ERROR_PIPE_BUSY)
|
||||
break;
|
||||
|
||||
if (!WaitNamedPipe(XTIER_RPC_PIPE, 5000)) {
|
||||
rcode = GetLastError();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hPipe == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
rcode = GetLastError();
|
||||
DbgTrace(0, " Create Pipe error:%d\r\n", rcode);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user