public async Task TestAsync(int _class, int _struct, CancellationToken cancellationToken = default(CancellationToken)) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("Test", TMessageType.Call, SeqId), cancellationToken); var args = new TestArgs(); args._class = _class; args._struct = _struct; await args.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (msg.Type == TMessageType.Exception) { var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw x; } var result = new TestResult(); await result.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); return; }