MCPcopy Create free account
hub / github.com/dobin/RedEdr / WaitForClient

Method WaitForClient

RedEdrShared/piping.cpp:102–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100
101
102BOOL PipeServer::WaitForClient() {
103 if (hPipe == NULL || hPipe == INVALID_HANDLE_VALUE) {
104 LOG_A(LOG_ERROR, "PipingSrv %s: Invalid pipe handle in WaitForClient",
105 pipe_name.c_str());
106 return FALSE;
107 }
108
109 // Wait for the client to connect
110 if (! ConnectNamedPipe(hPipe, NULL)) {
111 DWORD err = GetLastError();
112 if (err != ERROR_PIPE_CONNECTED) {
113 LOG_A(LOG_ERROR, "PipingSrv %s: Error handling client connection: %ld",
114 pipe_name.c_str(),
115 err);
116 CloseHandle(hPipe);
117 hPipe = NULL;
118 return FALSE;
119 }
120 }
121
122 return TRUE;
123}
124
125
126BOOL PipeServer::Send(char* buffer) {

Callers 1

Calls 1

LOG_AFunction · 0.50

Tested by

no test coverage detected