view 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
line wrap: on
line source
#{
	main <- {
		sock <- socket connectTo: "127.0.0.1" onPort: 12345
		sock send: "Hello, Socket!\n"
		response <- sock recv: 1024
		print: (string: response)
		sock close
		0
	}
}