Skip to content

Commit

Permalink
Fix Win socket demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Igotti committed Oct 24, 2017
1 parent 09b1f09 commit d872d80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/socket/src/main/kotlin/EchoServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ fun main(args: Array<String>) {

buffer.usePinned { pinned ->
while (true) {
val length = recv(commFd, pinned.addressOf(0), buffer.size.signExtend(), 0)
val length = recv(commFd, pinned.addressOf(0), buffer.size.signExtend(), 0).toInt()
.ensureUnixCallResult("read") { it >= 0 }

if (length == 0L) {
if (length == 0) {
break
}

Expand Down

0 comments on commit d872d80

Please sign in to comment.