Created
December 7, 2018 11:10
-
-
Save AxGord/4498f4533926f217c76100af80caeb23 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
import pony.net.SocketClient; | |
import pony.net.SocketServer; | |
import pony.time.MainLoop; | |
class NekoSockets { | |
private static function main():Void { | |
MainLoop.init(); | |
var port = 12345; | |
var server = new SocketServer(port); | |
server.onString << s -> trace('Server: $s'); | |
server.onString << MainLoop.stop; | |
var client = new SocketClient(port); | |
client.onConnect << () -> client.sendString('Hello world!'); | |
MainLoop.start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment