Skip to content

Instantly share code, notes, and snippets.

@thealmikey
Created April 11, 2019 18:46
Show Gist options
  • Save thealmikey/7681a6b4bb9f595f54fc72ee0755153c to your computer and use it in GitHub Desktop.
Save thealmikey/7681a6b4bb9f595f54fc72ee0755153c to your computer and use it in GitHub Desktop.
part2
import org.zeromq.ZMQ
fun main() {
val context = ZMQ.context(1)
val socket = context.socket(ZMQ.PUSH)
println("connecting to a pulling client...")
socket.connect("tcp://localhost:5897")
for (i in 1..20) {
Thread.sleep(100)
var plainRequest = "Hello "
var byteRequest = plainRequest.toByteArray()
byteRequest[byteRequest.size - 1] = 0
println("sending push $i $plainRequest")
socket.send(byteRequest, 0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment