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.

29 lines
694 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 it = require('it-is');
  6. var JSONStream = require('../');
  7. var str = fs.readFileSync(file);
  8. var server = net.createServer(function(client) {
  9. var data_calls = 0;
  10. var parser = JSONStream.parse();
  11. parser.on('error', function(err) {
  12. console.log(err);
  13. server.close();
  14. });
  15. parser.on('end', function() {
  16. console.log('END');
  17. server.close();
  18. });
  19. client.pipe(parser);
  20. });
  21. server.listen(9999);
  22. var client = net.connect({ port : 9999 }, function() {
  23. var msgs = str + '}';
  24. client.end(msgs);
  25. });