MaxConcurrentStreams returns a ServerOption that will apply a limit on the number of concurrent streams to each ServerTransport.
(n uint32)
| 464 | // MaxConcurrentStreams returns a ServerOption that will apply a limit on the number |
| 465 | // of concurrent streams to each ServerTransport. |
| 466 | func MaxConcurrentStreams(n uint32) ServerOption { |
| 467 | if n == 0 { |
| 468 | n = math.MaxUint32 |
| 469 | } |
| 470 | return newFuncServerOption(func(o *serverOptions) { |
| 471 | o.maxConcurrentStreams = n |
| 472 | }) |
| 473 | } |
| 474 | |
| 475 | // Creds returns a ServerOption that sets credentials for server connections. |
| 476 | func Creds(c credentials.TransportCredentials) ServerOption { |