udt4

0.1.1 • Public • Published

udt4

This is a wrapper around the UDT4 library.

See http://en.wikipedia.org/wiki/UDP-based_Data_Transfer_Protocol

This library is intentionally marked as 0.1.0 and should be considered alpha

usage

server

udt4.createServer(function (data) {
   console.log(data);
}).listen(1337);

client

var udt4 = require('../udt4');

var clt = udt4.createClient(1337, '127.0.0.1');
clt.write('data\n');
clt.end();

api

udt4.createServer([dataListener])

Returns a new server object.

The dataListener is a function which is automatically added to the 'data' event.

server.listen(port)

Begin accepting connections on the specified port. As the hostname is currently omitted, the server will accept connections directed to any IPv4 address (INADDR_ANY).

server.close()

Stops the server from accepting new connections and keeps existing connections. This function is asynchronous, the server is finally closed when all connections are ended and the server emits a 'close' event.

udt4.createClient()

Constructs a new UDT4 client. port and host refer to the server to be connected to.

client.connect(port, [host])

Opens a connection to the server

client.write(data)

Sends data to the server.

client.end()

Closes the connection to the server.

contributors

Anton WhalleyGitLab/No9Twitter/@dhigit9

Readme

Keywords

Package Sidebar

Install

npm i udt4

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • no9