27 Nov 2013, 10:14

steven swigart (1 post)

Following the instructions and code on pages 25 - 27, although when I telnet into port 5432 I don’t get any output from the program.

Problem solved: Changed the port and it worked fine…

27 Nov 2013, 12:25

Jim R. Wilson (68 posts)

Thanks for reporting this! I picked that particular port because it’s a high numbered port that seemed easy to remember—but it looks like it’s also the official port number for PostgreSQL.

Are you running PostgreSQL? Did the net-watcher.js program give you an error message at startup saying that it couldn’t bind the port?

28 Nov 2013, 09:06

Alan Gardner (6 posts)

Heh. Was just about to report this. Thanks for the confirm :)

16 Dec 2013, 10:16

Moandji Ezana (3 posts)

I had the same problem. Here’s the error message:

        throw er; // Unhandled 'error' event
Error: listen EADDRINUSE

I suggest changing the port number or pointing it out as a potential source of problems.

16 Dec 2013, 16:54

Jim R. Wilson (68 posts)

Thanks, that’s a good idea!

17 Mar 2014, 15:12
Richard mateosian 5x5a_smaller_pragsmall

Richard Mateosian (1 post)

I have a different problem with net-watcher.js. I thought I may have made an error typing it, but I get the same error with the code copied out of the online PDF. Changing the port number doesn’t change the symptoms.

The code runs, and in the first Cygwin console window, I see:

$ node --harmony net-watcher.js target.txt
Listening for subscribers...

In the second Cygwin console window, I telnet and see

$ telnet localhost 5721
Connected to localhost.
Escape character is '^]'.
Now watching 'target.txt' for changes...
Connection closed by foreign host.

Then the first window shows the following additional lines:

Subscriber connected.

    throw errnoException(process._errno, 'watch');
Error: watch ENOENT
    at errnoException (fs.js:1019:11)
    at FSWatcher.start (fs.js:1051:11)
    at Object.fs.watch (fs.js:1076:11)
    at Server.<anonymous> (C:...\net-watcher.js:12:22)
    at Server.EventEmitter.emit (events.js:95:17)
    at TCP.onconnection (net.js:1180:8)

Any ideas?

30 Apr 2014, 16:52

Todd W Crone (8 posts)

Phew…I changed the port to 5433 and all is well. I have PostgreSQL running but odd I didn’t get any bind exception. Just quietly ran with nothing interesting happening.

22 May 2014, 18:08
Selfie on 5-6-14 at 11.30 pm s_pragsmall

Aniket Suryavanshi (7 posts)

This post is a blessing. I had no clue why the book programs were not running on my machine. Thanks!

26 May 2014, 11:10

Jim R. Wilson (68 posts)

Richard, what OS and node version are you using?

  You must be logged in to comment