Skip to content

AndreiLosev/future_soket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages