uci-socket/test/sockets/tcpsocket-default.mjs

17 lines
326 B
JavaScript

import { Socket } from '../../src'
import process from './tcp-process'
let socket = new Socket({name:'tcp socket'})
let app = {port: socket.listen_opts.port}
socket.registerPacketProcessor(process)
;
(async () => {
await socket.create(app)
})().catch(err => {
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
})