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

wrapper for Socket, has methodh await read(count_byte).

  • reads the specified number of bytes from a TCP socket
  • for client

import 'dart:io';
import 'package:future_soket/future_soket.dart';

void main(List<String> arguments) async {
  final soket = FutureSoket();
  await soket.connect(InternetAddress("127.0.0.1"), 8855, Duration(seconds: 1));

  final buf1 = await soket.read(9);
  final buf2 = await soket.read(8);

}
  • for server:

import 'dart:io';
import 'package:future_soket/future_soket.dart';

void main(List<String> arguments) async {
  final server = await ServerSocket.bind("127.0.0.1", 7777);
 
  await for (var soket in server) {
    final fSoket = FutureSoket.fromSoket(soket);
    final buf1 = await fSoket.read(55);
  }
}

future_soket #

3
likes
125
points
50
downloads

Publisher

unverified uploader

Weekly Downloads

wrapper for Socket, has methodh await read(count_byte).

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on future_soket