uci-socket/test/tcpsocket.mjs

18 lines
320 B
JavaScript

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