Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
679 B

  1. var fs = require ('fs');
  2. var net = require('net');
  3. var join = require('path').join;
  4. var file = join(__dirname, 'fixtures','all_npm.json');
  5. var JSONStream = require('../');
  6. var server = net.createServer(function(client) {
  7. var parser = JSONStream.parse([]);
  8. parser.on('end', function() {
  9. console.log('close')
  10. console.error('PASSED');
  11. server.close();
  12. });
  13. client.pipe(parser);
  14. var n = 4
  15. client.on('data', function () {
  16. if(--n) return
  17. client.end();
  18. })
  19. });
  20. server.listen(9999);
  21. var client = net.connect({ port : 9999 }, function() {
  22. fs.createReadStream(file).pipe(client).on('data', console.log) //.resume();
  23. });