Skip to content

Commit 3407dab

Browse files
committed
Remove old references to old 'stream' event
1 parent 179a7f6 commit 3407dab

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/api.markdown

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ there is a stream, a child process emits an event when it exits. All
208208
objects which emit events are instances of `events.EventEmitter`.
209209

210210
Events are represented by a camel-cased string. Here are some examples:
211-
`'stream'`, `'data'`, `'messageBegin'`.
211+
`'connection'`, `'data'`, `'messageBegin'`.
212212

213213
Functions can be then be attached to objects, to be executed when an event
214214
is emitted. These functions are called _listeners_.
@@ -240,7 +240,7 @@ terminate execution and display the exception's stack trace.
240240

241241
Adds a listener to the end of the listeners array for the specified event.
242242

243-
server.on('stream', function (stream) {
243+
server.on('connection', function (stream) {
244244
console.log('someone connected!');
245245
});
246246

@@ -262,9 +262,9 @@ Remove a listener from the listener array for the specified event.
262262
var callback = function(stream) {
263263
console.log('someone connected!');
264264
};
265-
server.on('stream', callback);
265+
server.on('connection', callback);
266266
// ...
267-
server.removeListener('stream', callback);
267+
server.removeListener('connection', callback);
268268

269269

270270
### emitter.removeAllListeners(event)
@@ -277,10 +277,10 @@ Removes all listeners from the listener array for the specified event.
277277
Returns an array of listeners for the specified event. This array can be
278278
manipulated, e.g. to remove listeners.
279279

280-
server.on('stream', function (stream) {
280+
server.on('connection', function (stream) {
281281
console.log('someone connected!');
282282
});
283-
console.log(util.inspect(server.listeners('stream'));
283+
console.log(util.inspect(server.listeners('connection'));
284284
// [ [Function] ]
285285

286286

@@ -1623,7 +1623,7 @@ HTTP message headers are represented by an object like this:
16231623

16241624
{ 'content-length': '123'
16251625
, 'content-type': 'text/plain'
1626-
, 'stream': 'keep-alive'
1626+
, 'connection': 'keep-alive'
16271627
, 'accept': '*/*'
16281628
}
16291629

0 commit comments

Comments
 (0)