int main(int argc, char *argv[]) { if(argc != 2) { printf("BAD ARGUMENT: Pipe name required as parameter.\nPress Enter to continue..."); getchar(); return 1; } // Connect to pipe hOutputPipe = open(argv[1], O_RDONLY); if(hOutputPipe < 0) { printf("ERROR: Couldn't open pipe.\nPress Enter to terminate...\n"); getchar(); return 2; } simptris = 0; // Turn off character echo (so keys hit by user don't show up) DisableEcho(); ProcessIncoming(); return 0; }
int WorldSocket::handle_input_payload(void) { // set errno properly here on error !!! // now have a header and payload MANGOS_ASSERT(m_RecvPct.space() == 0); MANGOS_ASSERT(m_Header.space() == 0); MANGOS_ASSERT(m_RecvWPct != NULL); const int ret = ProcessIncoming(m_RecvWPct); m_RecvPct.base(NULL, 0); m_RecvPct.reset(); m_RecvWPct = NULL; m_Header.reset(); if (ret == -1) { errno = EINVAL; } return ret; }