Skip to content

a-parser/netlinkwrapper

This branch is 97 commits behind JacobFischer/netlinkwrapper:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6d0a1ad · Dec 22, 2019

History

45 Commits
Sep 26, 2018
Sep 26, 2018
Sep 1, 2018
Sep 1, 2018
Jul 4, 2019
Jul 3, 2019
Aug 14, 2015
Nov 23, 2016
Aug 31, 2018
Sep 1, 2018
Sep 1, 2018
Nov 23, 2016
Jul 2, 2019
Dec 22, 2019
Jul 2, 2019
Nov 2, 2019
Jul 4, 2019

Repository files navigation

netlinkwrapper

This is a simple node-gyp module wrapper for the C++ library netLink v1.0.0_pre6. Meaning this is a very simple wrapper for a very simple TCP library. Also, and perhaps most importantly, this is a TCP implementation that only works synchronously, as opposed to Node's asynchronous paradigm.

Purpose

Obviously node's net module is far more suited for TCP communications that this module. However, the net module can only work asynchronously, as is node's design. However if you are in the very rare situation where you need synchronous reading of sockets across platforms then this may suit you.

How to use

As with most node modules, use npm to install it for you.

npm install

Note: node-gyp is a dependency.

Requirements

As mentioned above, have node-gyp installed.

On Windows make sure you have the WIndows Build Tools installed (for ws2_32.lib). The most common way to attain these build tools is to just install Visual Studio 2013.

Example

var netlinkwrapper = require("netlinkwrapper");

var netlink = new netlinkwrapper();

netlink.connect(3000, "localhost");
netlink.blocking(false);

netlink.write("Are we human, or are we dancer?");

while(true) {
    var str = netlink.read(1024);
    console.log("read: " + str);
}

Docs

Docs can be found online at GitHub.

Alternatives

If you are looking for similar functionality, but without the node-gyp dependency I have made a similar (but much slower) module, SyncSocket.

Why the old version, and why that library?

Because it was the easiest for me to get working and met my needs.

About

A node-gyp netLink wrapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 81.1%
  • C 11.1%
  • JavaScript 6.7%
  • Python 1.1%