MCPcopy Create free account
hub / github.com/share/sharedb / ServerStream

Function ServerStream

lib/stream-socket.js:33–48  ·  view source on GitHub ↗
(socket)

Source from the content-addressed store, hash-verified

31
32
33function ServerStream(socket) {
34 Duplex.call(this, {objectMode: true});
35
36 this.socket = socket;
37
38 this.on('error', function(error) {
39 logger.warn('ShareDB client message stream error', error);
40 socket.close('stopped');
41 });
42
43 // The server ended the writable stream. Triggered by calling stream.end()
44 // in agent.close()
45 this.on('finish', function() {
46 socket.close('stopped');
47 });
48}
49util.inherits(ServerStream, Duplex);
50
51ServerStream.prototype.isServer = true;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…