initial
This commit is contained in:
2
test/index.ts
Normal file
2
test/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './smartipc.classes.ipcserver'
|
||||
export * from './smartipc.classes.ipcclient'
|
7
test/smartipc.classes.ipcclient.ts
Normal file
7
test/smartipc.classes.ipcclient.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import * as plugins from './smartipc.plugins'
|
||||
|
||||
export calss IpcClient {
|
||||
constructor() {
|
||||
|
||||
}
|
||||
}
|
44
test/smartipc.classes.ipcserver.ts
Normal file
44
test/smartipc.classes.ipcserver.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import * as plugins from './smartipc.plugins'
|
||||
|
||||
interface IIpcServeOptions {
|
||||
appspace?: string
|
||||
socketRoot?: string
|
||||
id?: string
|
||||
networkHost?: string //should resolve to 127.0.0.1 or ::1 see the table below related to this
|
||||
networkPort?: number
|
||||
encoding?: string
|
||||
rawBuffer?: boolean
|
||||
sync?: boolean
|
||||
silent?: boolean
|
||||
logInColor?: boolean
|
||||
logDepth?: number
|
||||
maxConnections?: number
|
||||
retry?: number
|
||||
maxRetries?: boolean
|
||||
stopRetrying?: boolean
|
||||
}
|
||||
|
||||
let defaultOptions: IIpcServeOptions = {
|
||||
appspace: 'app.',
|
||||
socketRoot: '/tmp/',
|
||||
id: plugins.os.hostname(),
|
||||
networkHost: 'localhost', //should resolve to 127.0.0.1 or ::1 see the table below related to this
|
||||
networkPort: 8000,
|
||||
encoding: 'utf8',
|
||||
rawBuffer: false,
|
||||
sync: false,
|
||||
silent: false,
|
||||
logInColor: true,
|
||||
logDepth: 5,
|
||||
maxConnections: 100,
|
||||
retry: 500,
|
||||
maxRetries: false,
|
||||
stopRetrying: false
|
||||
}
|
||||
|
||||
export class IpcServe {
|
||||
ipcOptions: IIpcServeOptions
|
||||
constructor(ipcOptionsArg: IIpcServeOptions) {
|
||||
this.ipcOptions = plugins.lodash.merge({},defaultOptions,ipcOptionsArg)
|
||||
}
|
||||
}
|
5
test/smartipc.plugins.ts
Normal file
5
test/smartipc.plugins.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import 'typings-global'
|
||||
export import beautylog = require('beautylog')
|
||||
export import lodash = require('lodash')
|
||||
export let nodeIpc = require('node-ipc')
|
||||
export import os = require('os')
|
Reference in New Issue
Block a user