nodejsinaction icon indicating copy to clipboard operation
nodejsinaction copied to clipboard

Cannot connect using telnet in Ch02 listing_211

Open piyushmakhija opened this issue 9 years ago • 1 comments

~/njs_in_action/ch02-intro-to-node/listing_211/index.js:9 this.clients[id] = client; ^

TypeError: Cannot set property '::ffff:127.0.0.1:55139' of undefined at EventEmitter.channel.on (~/njs_in_action/ch02-intro-to-node/listing_211/index.js:9:20) at emitTwo (events.js:106:13) at EventEmitter.emit (events.js:191:7) at Server.net.createServer.client (~/njs_in_action/ch02-intro-to-node/listing_211/index.js:20:11) at emitOne (events.js:96:13) at Server.emit (events.js:188:7) at TCP.onconnection (net.js:1463:8)

Getting this error when running "telnet 127.0.0.1 8888"

piyushmakhija avatar Dec 26 '16 01:12 piyushmakhija

u can manually put context into channel.on('join', func, channel) and change this in function to channel like this.clients should be channel.clients

VitoMakarevich avatar Jan 19 '17 12:01 VitoMakarevich