Code files

This commit is contained in:
Akhil
2017-07-31 11:33:31 +05:30
parent 073a63ebdd
commit b9ae409ec0
801 changed files with 17535 additions and 0 deletions
@@ -0,0 +1,17 @@
'use strict'
const net = require('net')
const pump = require('pump')
const ping = require('../ping-protocol-stream')
const server = net.createServer((socket) => {
const protocol = ping()
pump(socket, protocol, socket, closed)
})
function closed (err) {
if (err) console.error('connection closed with error', err)
else console.log('connection closed')
}
server.listen(3000)