multi_server_socket 1.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 92

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.2 #

  • Set SDK version constraint to >=2.0.0-dev.54.0 <3.0.0.

1.0.1 #

  • Support package:async v2.

1.0.0 #

  • Initial release.

Use this package as a library

1. Depend on it

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


dependencies:
  multi_server_socket: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub 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.2 Jul 19, 2018 Go to the documentation of multi_server_socket 1.0.2 Download multi_server_socket 1.0.2 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
Popularity:
Describes how popular the package is relative to other packages. [more]
92
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
85
Overall:
Weighted score of the above. [more]
92
Learn more about scoring.

We analyzed this package on Jun 4, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.1
  • pana: 0.12.17

Platforms

Detected platforms: Flutter, other

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

Health suggestions

Fix lib/multi_server_socket.dart. (-1.49 points)

Analysis of lib/multi_server_socket.dart reported 3 hints:

line 55 col 32: Use = to separate a named parameter from its default value.

line 55 col 52: Use = to separate a named parameter from its default value.

line 88 col 7: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Fix lib/src/utils.dart. (-1 points)

Analysis of lib/src/utils.dart reported 2 hints:

line 12 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

line 23 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and multi_server_socket.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.54.0 <3.0.0
async >=1.2.0 <3.0.0 2.2.0
Transitive dependencies
collection 1.14.11
Dev dependencies
test ^1.3.0