Skip to content

Instantly share code, notes, and snippets.

@fllfl
fllfl / document.md
Last active February 3, 2017 04:14 — forked from miketamis/document.md

Create new transport layer obj via calling Transport with IP

const transport = Transport('192.168.1.1');
transport.tryConnect.then(err, res) {
  if(err) {
 console.log(err);
@fllfl
fllfl / document.md
Last active February 8, 2017 22:07 — forked from miketamis/document.md

Create new transport layer obj via calling Transport with IP

const transport = new Transport('192.168.1.1');
transport.tryConnect().then(err, res) {
  if(err) {
 console.log(err);
@fllfl
fllfl / document.md
Last active February 9, 2017 21:50 — forked from miketamis/document.md

import these variables to listen to events, these are the 'accepted events':

import { 
  READ_DATA_EVENT_NAME, //fired after a successfull read
  CLOSE_READ_STREAM_EVENT_NAME, //fired after async socket closes the read stream
  DISCONNECT_EVENT_NAME, //fired after a disconnect - event has error as its 'body'
  CONNECT_EVENT_NAME, //fired after  connect - event has port and ip
  ERROR_EVENT_NAME, //fired after error - event the error, a message to say which method broke, and a tag if supplied