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

21 lines
413 B
JavaScript

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