OLD | NEW |
---|---|
(Empty) | |
1 #library('echoServer'); | |
2 | |
3 #import('../../lib/node/node.dart'); | |
4 #import('../../lib/node/net.dart'); | |
5 | |
6 void main() { | |
7 // Note: the callback function must use the type "Socket" for the socket argum ent, | |
Jennifer Messerly
2012/01/21 01:00:31
hmmm. There's some sort of bug here then. You mean
| |
8 // otherwise frog will strip out the Socket.write method. | |
9 var server = net.createServer((Socket socket) { | |
10 socket.write("Echo server\r\n"); | |
11 socket.pipe(socket); | |
12 }); | |
13 | |
14 server.listen(1337, "127.0.0.1"); | |
15 print('Listening on port 1337'); | |
16 } | |
OLD | NEW |