uci-socket/test/tcpsocket2.mjs

21 lines
406 B
JavaScript
Raw Normal View History

import { Socket } from '../src'
let socket = new Socket({port:9080, name:'tcp socket 8081'})
// socket.spp = 'saltprocessPacket'
socket.pp ='sprocessPacket'
socket.sprocessPacket = async function (packet) {
packet.payload = 'alt tcp processed '+packet.payload
return packet
}
;
(async () => {
await socket.create()
})().catch(err => {
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
})