unix_domain_socket 0.0.0-dev.4

Native Dart bindings for Unix domain sockets

Changelog #

0.0.0-dev #

  • Initial prerelease


import 'package:unix_domain_socket/unix_domain_socket.dart';

import "dart:convert";

void main() {
  var socket = UnixDomainSocket.create("/run/cups/cups.sock");

  var request = Utf8Encoder().convert(
      "GET / HTTP/1.1\r\nHost:\r\nConnection: close\r\n\r\n");
  var n_written = socket.write(request);
  print("wrote $n_written");

  var response = socket.read(1024);
  var text = Utf8Decoder().convert(response);
  print("read $text");

Use this package as a library

1. Depend on it

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

  unix_domain_socket: ^0.0.0-dev.4

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:unix_domain_socket/unix_domain_socket.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 12, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health issues and suggestions

Document public APIs. (-1 points)

8 out of 8 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

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

Analysis of lib/unix_domain_socket.dart reported 3 hints:

line 32 col 25: Unnecessary new keyword.

line 81 col 25: Unnecessary new keyword.

line 97 col 25: Unnecessary new keyword.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
ffi ^0.1.3 0.1.3
packages ^0.4.4 0.4.4
Transitive dependencies
ansicolor 1.0.2
args 1.5.2
collection 1.14.12
console_log_handler 1.1.6
intl 0.16.1
logging 0.11.4
optional 3.1.0 4.0.1
path 1.6.4