comparison samples/sock.tp @ 147:4c96a393103e

Add support for receiving data from a socket
author Mike Pavone <pavone@retrodev.com>
date Fri, 09 Aug 2013 04:57:21 -0700
parents 7db37f040a6f
children
comparison
equal deleted inserted replaced
146:d8f92ebf1ff6 147:4c96a393103e
1 #{ 1 #{
2 main <- { 2 main <- {
3 sock <- socket connectTo: "127.0.0.1" onPort: 12345 3 sock <- socket connectTo: "127.0.0.1" onPort: 12345
4 sock send: "Hello, Socket!\n" 4 sock send: "Hello, Socket!\n"
5 response <- sock recv: 1024
6 print: (string: response)
5 sock close 7 sock close
6 0 8 0
7 } 9 }
8 } 10 }