Last active
December 11, 2015 00:09
-
-
Save nathanpc/4514732 to your computer and use it in GitHub Desktop.
Fix for the QUIT bug in leafIRC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void *IRC_Client::handle_recv(void) { | |
// recv some data. | |
int numbytes; | |
char buffer[MAXDATASIZE]; | |
while (true) { | |
numbytes = recv(socket_descriptor, buffer, MAXDATASIZE - 1, 0); | |
buffer[numbytes] = '\0'; | |
if (numbytes == 0) { | |
cout << "Connection terminated" << endl; | |
system("stty cooked"); | |
exit(0); | |
} | |
message_handler(buffer); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment