rsocket 1.0.0 icon indicating copy to clipboard operation
rsocket: ^1.0.0 copied to clipboard

RSocket for Dart

RSocket Dart SDK #

Examples #

Client #

import 'package:rsocket/rsocket_connector.dart';
import 'package:rsocket/payload.dart';

void main() async {
  var rsocket = await RSocketConnector.create().connect('tcp://127.0.0.1:42252');
  var result = await rsocket.requestResponse(Payload.fromText('text/plain', 'Ping'));
  print(result.getDataUtf8());
}

Server #

import 'package:rsocket/rsocket_server.dart';
import 'package:rsocket/payload.dart';
import 'package:rsocket/rsocket.dart';

void main() async {
  const listenUrl = 'tcp://0.0.0.0:42252';
  var closeable = await RSocketServer.create(requestResponseAcceptor((payload) {
    return Future.value(Payload.fromText('text/plain', 'Pong'));
  })).bind(listenUrl);
  print('RSocket Server started on ${listenUrl}');
}

RSocket Service Proxy & Routing #

Please refer https://github.com/rsocket/rsocket-dart/tree/master/lib/route

RSocket #

  • Operations
    • REQUEST_FNF
    • REQUEST_RESPONSE
    • REQUEST_STREAM
    • REQUEST_CHANNEL
    • METADATA_PUSH
  • More Operations
    • Error
    • Cancel
    • Keepalive
  • QoS
    • RequestN
    • Lease
  • Transport
    • TCP
    • Websocket
  • High Level APIs
    • Client
    • Server
  • Misc
    • RxDart

References #

17
likes
100
pub points
69%
popularity

Publisher

unverified uploader

RSocket for Dart

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Icon for licenses.Apache-2.0 (LICENSE)

Dependencies

collection, rxdart

More

Packages that depend on rsocket