connecta 1.0.0-beta1 copy "connecta: ^1.0.0-beta1" to clipboard
connecta: ^1.0.0-beta1 copied to clipboard

Simplify and streamline socket communication in Dart applications

example/main.dart

import 'dart:developer';

import 'package:connecta/connecta.dart';

Future<void> main() async {
  final connecta = Connecta(
    ConnectaToolkit(
      hostname: 'localhost',
      port: 443,
      startTLS: true,
      certificatePath: 'public/cert.pem',
      keyPath: 'public/key.pem',
    ),
  );

  try {
    await connecta.connect(onData: (value) => log(value.toString()));

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

    connecta.send('hert');
  } on ConnectaException catch (error) {
    log(error.message);
  }
}
1
likes
0
pub points
37%
popularity

Publisher

verified publishervsevex.me

Simplify and streamline socket communication in Dart applications

Repository (GitHub)
View/report issues

Topics

#network #tls #tcp #wrapper

License

unknown (license)

More

Packages that depend on connecta