hybridConnector.Socket(socket, opts)

Tcp socket wrapper with package compositing. Collect the package from socket and emit a completed package with 'data' event. Uniform with ws.WebSocket interfaces.

new Socket(socket, opts)

Parameters:
Name Type Description
socket Object origin socket from node.js net module
opts Object options parameter. opts.headSize size of package head opts.headHandler(headBuffer) handler for package head. caculate and return body size from head data.