connecta 1.2.0 copy "connecta: ^1.2.0" to clipboard
connecta: ^1.2.0 copied to clipboard

Simplify and streamline socket communication in Dart applications

Connecta #

Connecta is a Dart package that wraps TLS and TCP communication protocol connections under a package and provides a configurable way to manage these configurations.

Installation #

Add the following to your pubspec.yaml file:

dependencies:
  connecta: ^1.1.0

Then run:

dart pub get

Usage #

import 'dart:developer';

import 'package:connecta/connecta.dart';

Future<void> main() async {
  final connecta = Connecta(
    ConnectaToolkit(
      hostname: 'example.org',
      port: 443,
      connectionType: ConnectionType.tls,
    ),
  );

  try {
    await connecta.connect(ConnectaListener(onData: (data) => log(String.fromCharCodes(data))));

    /// Upgrade the connection to secure if needed.
    await connecta.upgradeConnection();

    connecta.send('hello');
  } on ConnectaException catch (error) {
    log(error.message);
  }
}

Contributing to Connecta #

I do welcome and appreciate contributions from the community to enhance the Connecta. If you have any improvements, bug fixes, or new features to contribute, you can do so by creating a pull request.

0
likes
160
pub points
34%
popularity

Publisher

verified publishervsevex.me

Simplify and streamline socket communication in Dart applications

Repository (GitHub)
View/report issues

Topics

#network #tls #tcp #wrapper

Documentation

API reference

License

MIT (license)

More

Packages that depend on connecta