dtorrent_common 1.0.5 copy "dtorrent_common: ^1.0.5" to clipboard
dtorrent_common: ^1.0.5 copied to clipboard

A common library for Dart torrent client development. Include some common methods and class.

example/dtorrent_common_example.dart

import 'dart:io';
import 'dart:typed_data';

import 'package:dtorrent_common/dtorrent_common.dart';

void main() {
  var c = CompactAddress(
      InternetAddress.fromRawAddress(Uint8List.fromList(randomBytes(4))),
      12112);
  print(c);

  var c1 = CompactAddress.parseIPv4Address(c.toBytes());
  print(c1);

  var c2 = c1?.clone();
  print(c2 == c);
  var compactList = [c];
  if (c1 != null) {
    compactList.add(c1);
  }
  if (c2 != null) {
    compactList.add(c2);
  }
  var bytes = CompactAddress.multipleAddressBytes(compactList);
  print(bytes);
  var l = CompactAddress.parseIPv4Addresses(bytes);
  print(l);
  l.clear();

  /// find public trackers:
  findPublicTrackers().listen((urls) {
    print(urls);
  });
}
1
likes
0
points
142
downloads

Publisher

unverified uploader

Weekly Downloads

A common library for Dart torrent client development. Include some common methods and class.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on dtorrent_common