Skip to content

Commit

Permalink
move builder out
Browse files Browse the repository at this point in the history
  • Loading branch information
rikaaa0928 committed Oct 14, 2024
1 parent 5bd7b3d commit b89e731
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/moe/rikaaa0928/uot/UogClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class UogClient(val lPort: Int, val endpoint: String, val password: String) : Br
return
}
stop.set(false)
val url = URL(endpoint)
val builder = AndroidChannelBuilder.forAddress(url.host, url.port)
if (!url.protocol.equals("https")) {
builder.usePlaintext()
}
GlobalScope.launch {
while (!stop.get()) {
try {
val id = random.nextInt(1000);
val url = URL(endpoint)
val builder = AndroidChannelBuilder.forAddress(url.host, url.port)
if (!url.protocol.equals("https")) {
builder.usePlaintext()
}
val channel = builder.build()
val service = UdpServiceGrpcKt.UdpServiceCoroutineStub(channel)
if (req != null) {
Expand Down

0 comments on commit b89e731

Please sign in to comment.