| 120 | } |
| 121 | |
| 122 | private static async Task RunAsync(string[] args, CancellationToken cancellationToken) |
| 123 | { |
| 124 | var selectedTransport = GetTransport(args); |
| 125 | var selectedBuffering = GetBuffering(args); |
| 126 | var selectedProtocol = GetProtocol(args); |
| 127 | var multiplex = GetMultiplex(args); |
| 128 | |
| 129 | if (selectedTransport == Transport.Http) |
| 130 | { |
| 131 | if (multiplex) |
| 132 | throw new Exception("This tutorial sample code does not yet allow multiplex over http (although Thrift itself of course does)"); |
| 133 | new HttpServerSample().Run(cancellationToken); |
| 134 | } |
| 135 | else |
| 136 | { |
| 137 | await RunSelectedConfigurationAsync(selectedTransport, selectedBuffering, selectedProtocol, multiplex, cancellationToken); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | |
| 142 | private static bool GetMultiplex(string[] args) |