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