Skip to content

Commit

Permalink
Node unix socket server test
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoaguilar committed Apr 28, 2015
1 parent df2aac5 commit 732cdb5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions factory.js/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ var path = '/tmp/echo.sock';
fs.unlink(path, function () {
var server = net.createServer(function(c) {
console.log('server connected');
c.on('end', function() {

});


server.on('end', function() {
console.log('server disconnected');
});

c.on('data', function (data) {
server.on('data', function (data) {
console.log(data);
});

c.on('error', function (err) {
server.on('error', function (err) {
console.log(err);
});
c.write('hello\r\n');
c.pipe(c);
});
server.listen(path, function() {
console.log('server bound on %s', path);
});
server.write('hello\r\n');
server.pipe(c);
});

0 comments on commit 732cdb5

Please sign in to comment.