2018-01-23 16:02:56 -08:00
|
|
|
import { Socket } from '../../src'
|
2018-01-25 18:07:45 -08:00
|
|
|
import process from './tcp-process'
|
2018-01-23 16:02:56 -08:00
|
|
|
|
|
|
|
let socket = new Socket({port:9080, name:'tcp socket 9080'})
|
|
|
|
|
2018-01-25 18:07:45 -08:00
|
|
|
let app = {port: socket.listen_opts.port}
|
|
|
|
socket.registerPacketProcessor(process)
|
2018-01-23 16:02:56 -08:00
|
|
|
;
|
|
|
|
(async () => {
|
|
|
|
|
|
|
|
await socket.create(app)
|
|
|
|
|
|
|
|
})().catch(err => {
|
|
|
|
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
|
|
|
|
})
|