Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Side by Side Diff: frog/samples/node/echoServer.dart

Issue 9034014: Add support for the node net module. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: new version of minfrog Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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,
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698