Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { ISharedStruct, ISharedUnion } from '../../generated/shared'
import { IMetadata, MetadataCodec } from '../../generated/common'
import { APACHE_SERVER_CONFIG } from '../../config'
export const lab = Lab.script()
const describe = lab.describe
const it = lab.it
const before = lab.before
const after = lab.after
const afterEach = lab.afterEach
const frameCodec: thrift.ThriftFrameCodec = new thrift.ThriftFrameCodec()
describe('TcpConnection', () => {
let server: net.Server
before(async () => {
return new Promise((resolve, reject) => {
server = createServer()
server.listen(APACHE_SERVER_CONFIG.port, 'localhost', () => {
console.log(
`TCP server running on port[${APACHE_SERVER_CONFIG.port}]`,
)
resolve()
})
})
})
constructor(socket: tls.TLSSocket | net.Socket, logger: LogFunction) {
this._hasSession = false
this.logger = logger
this.socket = socket
this.frameCodec = new ThriftFrameCodec()
this.initializeSocket()
}