Skip to content

Instantly share code, notes, and snippets.

@Matheus28
Created July 4, 2013 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Matheus28/2871c92df9de8a01e5c3 to your computer and use it in GitHub Desktop.
Save Matheus28/2871c92df9de8a01e5c3 to your computer and use it in GitHub Desktop.
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