[DOCS] Kotlin: Add server.awaitTermination() call to starting server example (#972)

This commit is contained in:
Fabian Fritzsche 2022-05-25 23:32:50 +02:00 committed by GitHub
parent 8f01c3d651
commit f96375643f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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}