multi_server_socket 1.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 95

An implementation of dart:io's ServerSocket that wraps multiple servers and forwards methods to all of them. It's useful for listening on multiple network interfaces while still having a unified way of controlling the servers. In particular, it supports serving on both the IPv4 and IPv6 loopback addresses using MultiServerSocket.loopback.

import 'package:multi_server_socket/multi_server_socket.dart';

main() async {
  // Sockets connecting to either http://127.0.0.1:8080 and http://[::1]:8080
  // will be emitted by [server].
  var server = await MultiServerSocket.loopback(8080);

  server.listen((socket) {
    // Communicate with [socket].
  });
}

1.0.1

  • Support package:async v2.

1.0.0

  • Initial release.

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  multi_server_socket: "^1.0.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:multi_server_socket/multi_server_socket.dart';
        
Version Uploaded Documentation Archive
1.0.1 Jan 3, 2018 Go to the documentation of multi_server_socket 1.0.1 Download multi_server_socket 1.0.1 archive
1.0.0 Dec 1, 2017 Go to the documentation of multi_server_socket 1.0.0 Download multi_server_socket 1.0.0 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
90 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
95
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:multi_server_socket/multi_server_socket.dart with components: io.

Suggestions

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use multi_server_socket.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.13.0 <2.0.0
async >=1.2.0 <3.0.0 2.0.6
Transitive dependencies
collection 1.14.9
Dev dependencies
test ^0.12.0