Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import asyncnet, strutils, asyncdispatch
- # var name = "lapi"
- proc writes(client: AsyncSocket) {. async .} =
- var msg = readLine(stdin)
- discard client.send(msg & "\c\L")
- proc main() {. async .} =
- var client = newAsyncSocket()
- discard client.connect("192.168.0.23", Port(6666))
- while true:
- let message = await client.recvLine()
- echo(message)
- await writes(client)
- waitFor main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement