chrome-socket
streaming socket interface for chrome tcp
Last updated 8 years ago by shtylman .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install chrome-socket 
SYNC missed versions from official npm registry.

chrome-socket

chrome tcp socket interface with streaming powers

use

var Socket = require('chrome-socket');

// create a new tcp socket (not connected or listening yet)
// socket is a stream and an event emitter
var socket = new Socket();

socket.connect(host, port);

// socket has connected
socket.once('connect', function() {
});

socket.on('data', function(chunk) {
    // chunck is an ArrayBuffer of data received from the socket
});

socket.on('error', function(err) {
    // uh oh!
});

API

The API is modeled after node.js sockets. However, it emits and deals with ArrayBuffer objects versus node Buffers and provides no encoding. Encoding is provided by piping the socket to other streams.

methods

connect

write

end

events

connect

data

error

install

Use npm to install.

npm install chrome-socket

Current Tags

  • 0.0.1                                ...           latest (8 years ago)

2 Versions

  • 0.0.1                                ...           8 years ago
  • 0.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |