@@ -208,7 +208,7 @@ there is a stream, a child process emits an event when it exits. All
208
208
objects which emit events are instances of ` events.EventEmitter ` .
209
209
210
210
Events are represented by a camel-cased string. Here are some examples:
211
- ` 'stream ' ` , ` 'data' ` , ` 'messageBegin' ` .
211
+ ` 'connection ' ` , ` 'data' ` , ` 'messageBegin' ` .
212
212
213
213
Functions can be then be attached to objects, to be executed when an event
214
214
is emitted. These functions are called _ listeners_ .
@@ -240,7 +240,7 @@ terminate execution and display the exception's stack trace.
240
240
241
241
Adds a listener to the end of the listeners array for the specified event.
242
242
243
- server.on('stream ', function (stream) {
243
+ server.on('connection ', function (stream) {
244
244
console.log('someone connected!');
245
245
});
246
246
@@ -262,9 +262,9 @@ Remove a listener from the listener array for the specified event.
262
262
var callback = function(stream) {
263
263
console.log('someone connected!');
264
264
};
265
- server.on('stream ', callback);
265
+ server.on('connection ', callback);
266
266
// ...
267
- server.removeListener('stream ', callback);
267
+ server.removeListener('connection ', callback);
268
268
269
269
270
270
### emitter.removeAllListeners(event)
@@ -277,10 +277,10 @@ Removes all listeners from the listener array for the specified event.
277
277
Returns an array of listeners for the specified event. This array can be
278
278
manipulated, e.g. to remove listeners.
279
279
280
- server.on('stream ', function (stream) {
280
+ server.on('connection ', function (stream) {
281
281
console.log('someone connected!');
282
282
});
283
- console.log(util.inspect(server.listeners('stream '));
283
+ console.log(util.inspect(server.listeners('connection '));
284
284
// [ [Function] ]
285
285
286
286
@@ -1623,7 +1623,7 @@ HTTP message headers are represented by an object like this:
1623
1623
1624
1624
{ 'content-length': '123'
1625
1625
, 'content-type': 'text/plain'
1626
- , 'stream ': 'keep-alive'
1626
+ , 'connection ': 'keep-alive'
1627
1627
, 'accept': '*/*'
1628
1628
}
1629
1629
0 commit comments