-
-
Save Matheus28/2871c92df9de8a01e5c3 to your computer and use it in GitHub Desktop.
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 GameServerConnection::OnConnectionData(uv_stream_t* stream, ssize_t nread, uv_buf_t buf){ | |
uv_tcp_t *tcp = (uv_tcp_t*) stream; | |
GameServerConnection *self = (GameServerConnection *) tcp->data; | |
// Error | |
if(nread == -1){ | |
fprintf(stderr, "Connection data error %s\n", uv_err_name(uv_last_error(GameClient::GetLoop()))); | |
self->Destroy(); | |
return; | |
} | |
if(nread != 0){ | |
printf("Received data\n"); | |
} | |
free(buf.base); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment