websocket-multiplex icon indicating copy to clipboard operation
websocket-multiplex copied to clipboard

Close socket inside channel

Open edge90 opened this issue 10 years ago • 0 comments

The following example code does not work correctly, the end method is undefined.

var ann = multiplexer.registerChannel('ann');
ann.on('connection', function(conn) {
    conn.write('Ann says hi!');
    conn.on('data', function(data) {
        conn.write('Ann nods: ' + data);
        conn.end();
    });
});

If I log the "conn" variable with console.log it outputs:

{ conn: { _session: { ....

So I'll have to call conn.conn.end to get this to work.

node v0.10.33

edge90 avatar Nov 27 '14 14:11 edge90