mirror of https://github.com/grpc/grpc.io.git
[DOCS] Kotlin: Add server.awaitTermination() call to starting server example (#972)
This commit is contained in:
parent
8f01c3d651
commit
f96375643f
|
@ -312,8 +312,8 @@ fun main(args: Array<String>) {
|
|||
val port = 8980
|
||||
val server = RouteGuideServer(port)
|
||||
server.start()
|
||||
/* ... */
|
||||
}
|
||||
server.awaitTermination()
|
||||
}
|
||||
```
|
||||
|
||||
A server instance is built and started using a `ServerBuilder` as follows:
|
||||
|
@ -324,6 +324,8 @@ A server instance is built and started using a `ServerBuilder` as follows:
|
|||
and pass it to the builder's `addService()` method.
|
||||
1. Call `build()` and `start()` on the builder to create and start an RPC server
|
||||
for the route guide service.
|
||||
1. Call `awaitTermination()` on the server to block the main function until
|
||||
the application receives a signal to terminate.
|
||||
|
||||
### Creating the client {#client}
|
||||
|
||||
|
|
Loading…
Reference in New Issue