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-13 20:46:14 -08:00
|
|
|
|
2018-01-30 16:59:57 -08:00
|
|
|
let socket = new Socket({name:'tcp socket', log:false})
|
2018-01-13 20:46:14 -08:00
|
|
|
|
2018-01-25 18:07:45 -08:00
|
|
|
socket.registerPacketProcessor(process)
|
2018-01-30 16:59:57 -08:00
|
|
|
socket.packet.port = socket.listen_opts.port
|
2018-01-25 18:07:45 -08:00
|
|
|
|
2018-01-13 20:46:14 -08:00
|
|
|
;
|
|
|
|
(async () => {
|
|
|
|
|
2018-01-30 16:59:57 -08:00
|
|
|
await socket.create()
|
2018-01-13 20:46:14 -08:00
|
|
|
|
|
|
|
})().catch(err => {
|
|
|
|
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
|
|
|
|
})
|