-
-
Save Arunshaik2001/784d30fd4199f0f4978a0f9bc0d0ede7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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