Created
April 11, 2019 18:46
-
-
Save thealmikey/7681a6b4bb9f595f54fc72ee0755153c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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