How to use the @creditkarma/thrift-server-core.ThriftFrameCodec function in @creditkarma/thrift-server-core

To help you get started, we’ve selected a few @creditkarma/thrift-server-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github creditkarma / thrift-server / packages / thrift-integration / src / client / connections / TcpConnection.spec.ts View on Github external
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()
            })
        })
    })
github creditkarma / thrift-server / packages / thrift-client / src / main / connections / Connection.ts View on Github external
constructor(socket: tls.TLSSocket | net.Socket, logger: LogFunction) {
        this._hasSession = false
        this.logger = logger
        this.socket = socket
        this.frameCodec = new ThriftFrameCodec()
        this.initializeSocket()
    }