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
| val byteReply = socket.recv(0) | |
| var plainReply = String(byteReply, 0, byteReply.size - 1) | |
| println("Received reply $plainReply") | |
| } |
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
| import org.zeromq.ZMQ | |
| fun main() { | |
| val context = ZMQ.context(1) | |
| val socket = context.socket(ZMQ.REP) | |
| println("Starting the server...") | |
| socket.bind("tcp://*:5897") |
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
| socket.send(rawReply, 0) |
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
| var plainReply = "World " | |
| var rawReply = plainReply.toByteArray() |
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
| fun main() { | |
| val context = ZMQ.context(1) | |
| val socket = context.socket(ZMQ.REP) | |
| println("Starting the server...") | |
| socket.bind("tcp://*:5897") | |
| while (true) { | |
| val rawRequest = socket.recv(0) | |
| val cleanRequest = String(rawRequest, 0, rawRequest.size - 1) |
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
| val cleanRequest = String(rawRequest, 0, rawRequest.size - 1) | |
| println("Request received : $cleanRequest") |
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
| var rawReply = plainReply.toByteArray() | |
| rawReply[rawReply.size - 1] = 0 |
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
| while (true) { | |
| val rawRequest = socket.recv(0) | |
| ... | |
| } |
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
| import org.zeromq.ZMQ | |
| fun main() { | |
| val context = ZMQ.context(1) | |
| val socket = context.socket(ZMQ.REP) | |
| } |
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
| plugins { | |
| id 'org.jetbrains.kotlin.jvm' version '1.3.21' | |
| } | |
| group 'almikey' | |
| version '1.0-SNAPSHOT' | |
| repositories { | |
| mavenCentral() | |
| } |