How to use rsocket-tcp-client - 4 common examples

To help you get started, we’ve selected a few rsocket-tcp-client 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 rsocket / rsocket-js / packages / rsocket-tck / src / RSocketTckClient.js View on Github external
async function connect(options: Options): Promise> {
  const client = new RSocketClient({
    setup: {
      dataMimeType: 'text/plain',
      keepAlive: 1000000, // avoid sending during test
      lifetime: 100000,
      metadataMimeType: 'text/plain',
    },
    transport: new RSocketTcpClient({
      host: options.host,
      port: options.port,
    }),
  });
  return new Promise((resolve, reject) => {
    client.connect().subscribe({
      onComplete: resolve,
      onError: reject,
    });
  });
}
github rsocket / rsocket-js / packages / rsocket-examples / src / SimpleCli.js View on Github external
function getClientTransport(protocol: string, options: ServerOptions) {
  switch (protocol) {
    case 'tcp':
    default:
      return new RSocketTcpClient({...options});
    case 'ws':
      return new RSocketWebSocketClient({
        url: 'ws://' + options.host + ':' + options.port,
        wsCreator: url => {
          return new WebSocket(url);
        },
      });
  }
}
github rsocket / rsocket-js / packages / rsocket-tcp-server / src / RSocketTCPServer.js View on Github external
const onConnection = (socket: net.Socket) => {
        subscriber.onNext(new RSocketTcpConnection(socket, this._encoders));
      };
      subscriber.onSubscribe({

rsocket-tcp-client

RSocket TCP client for use in Node.js environments

Apache-2.0
Latest version published 10 months ago

Package Health Score

70 / 100
Full package analysis