Last active
May 19, 2018 19:50
-
-
Save enthus1ast/14016b538c0433c76287f83ea2309aa9 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 net # # https://nim-lang.org/docs/net.html | |
| var socket = newSocket() | |
| socket.bindAddr(Port(1234)) | |
| socket.listen() | |
| var client = new Socket | |
| var address = "" | |
| while true: | |
| socket.acceptAddr(client, address) | |
| echo("Client connected from: ", address) | |
| # Client connected from: 127.0.0.1 | |
| # btcp.nim(9) btcp | |
| # net.nim(793) acceptAddr | |
| # system.nim(3788) failedAssertImpl | |
| # system.nim(3781) raiseAssert | |
| # system.nim(2843) sysFatal | |
| # Error: unhandled exception: int(client.fd) <= 0 Client socket needs to be initialised with `new`, not `newSocket`. [AssertionError] | |
| # Error: execution of an external program failed: '/home/david/nimPlayground/btcp ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment