Skip to content

Instantly share code, notes, and snippets.

@Arunshaik2001
Created December 25, 2022 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arunshaik2001/784d30fd4199f0f4978a0f9bc0d0ede7 to your computer and use it in GitHub Desktop.
Save Arunshaik2001/784d30fd4199f0f4978a0f9bc0d0ede7 to your computer and use it in GitHub Desktop.
fun sendMessage(
message: String,
channel: ManagedChannel?
):String? {
return try {
val stub = GreeterGrpc.newBlockingStub(channel)
val request = HelloRequest.newBuilder().setName(message).build()
val reply = stub.sayHello(request)
reply.message
} catch (e: Exception) {
e.message
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment