uci-socket/test/sockets/usocket-default-name.mjs

20 lines
398 B
JavaScript
Raw Normal View History

import { Socket } from '../../src'
const USOCKET = __dirname + '/test.sock'
let socket = new Socket(USOCKET,{name:'unix socket'})
socket.processPacket = async function (packet) {
packet.payload = 'using alt processor with default name '+packet.payload
return packet
}
;
(async () => {
await socket.create()
})().catch(err => {
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
})