Changeset 1836
- Timestamp:
- 14/09/2007 23:12:28 (4 years ago)
- File:
-
- 1 edited
-
box/chris/general/lib/server/ServerControl.h (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/chris/general/lib/server/ServerControl.h
r1526 r1836 10 10 #include "BoxPortsAndFiles.h" 11 11 12 static std::string sPipeName; 13 14 static void SetNamedPipeName(const std::string& rPipeName) 15 { 16 sPipeName = rPipeName; 17 } 18 12 19 static bool SendCommands(const std::string& rCmd) 13 20 { … … 16 23 try 17 24 { 18 connection.Connect( BOX_NAMED_PIPE_NAME);25 connection.Connect(sPipeName); 19 26 } 20 27 catch(...) 21 28 { 22 printf("Failed to connect to daemon control socket.\n");29 BOX_ERROR("Failed to connect to daemon control socket"); 23 30 return false; 24 31 } … … 31 38 if(!getLine.GetLine(configSummary)) 32 39 { 33 printf("Failed to receive configuration summary from daemon\n");40 BOX_ERROR("Failed to receive configuration summary from daemon"); 34 41 return false; 35 42 } … … 38 45 if(getLine.IsEOF()) 39 46 { 40 printf("Server rejected the connection.\n");47 BOX_ERROR("Server rejected the connection"); 41 48 return false; 42 49 } … … 48 55 &minimumFileAge, &maxUploadWait) != 4) 49 56 { 50 printf("Config summary didn't decode\n");57 BOX_ERROR("Config summary didn't decode"); 51 58 return false; 52 59 } … … 82 89 else if (line == "error") 83 90 { 84 printf("ERROR (%s)\n", rCmd.c_str());91 BOX_ERROR(rCmd); 85 92 break; 86 93 } 87 94 else 88 95 { 89 printf("WARNING: Unexpected response to command '%s': "90 "%s", rCmd.c_str(), line.c_str());96 BOX_WARNING("Unexpected response to command '" << 97 rCmd << "': " << line) 91 98 } 92 99 } … … 105 112 if (hProcess == NULL) 106 113 { 107 printf("Failed to open process %d: error %d\n",108 pid, (int)GetLastError());114 BOX_ERROR("Failed to open process " << pid << ": " << 115 GetErrorMessage(GetLastError())); 109 116 return false; 110 117 } … … 112 119 if (!TerminateProcess(hProcess, 1)) 113 120 { 114 printf("Failed to terminate process %d: error %d\n",115 pid, (int)GetLastError());121 BOX_ERROR("Failed to terminate process " << pid << ": " << 122 GetErrorMessage(GetLastError())); 116 123 CloseHandle(hProcess); 117 124 return false;
Note: See TracChangeset
for help on using the changeset viewer.
