21 lines
365 B
JavaScript
21 lines
365 B
JavaScript
|
import { Socket } from '../src'
|
||
|
|
||
|
let socket = new Socket({name:'tcp socket'})
|
||
|
|
||
|
const app = {
|
||
|
spp: 'sprocessPacket',
|
||
|
sprocessPacket: async function (packet) {
|
||
|
packet.payload = 'tcp processed '+packet.payload
|
||
|
return packet
|
||
|
}
|
||
|
}
|
||
|
|
||
|
;
|
||
|
(async () => {
|
||
|
|
||
|
await socket.create(app)
|
||
|
|
||
|
})().catch(err => {
|
||
|
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
|
||
|
})
|