2018-01-13 20:46:14 -08:00
|
|
|
import { Socket } from '../src'
|
|
|
|
|
2018-01-18 21:21:06 -08:00
|
|
|
let socket = new Socket({name:'tcp socket'})
|
2018-01-13 20:46:14 -08:00
|
|
|
|
2018-01-19 20:43:16 -08:00
|
|
|
socket.processPacket = async function (packet) {
|
|
|
|
packet.payload = 'tcp processed '+packet.payload
|
|
|
|
return packet
|
2018-01-13 20:46:14 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
;
|
|
|
|
(async () => {
|
|
|
|
|
2018-01-19 20:43:16 -08:00
|
|
|
await socket.create()
|
2018-01-13 20:46:14 -08:00
|
|
|
|
|
|
|
})().catch(err => {
|
|
|
|
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
|
|
|
|
})
|