small medium large xlarge

Generic-user-small
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…

Avatar_pragsmall
27 Nov 2013, 12:25
Jim R. Wilson (69 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?

Generic-user-small
28 Nov 2013, 09:06
Alan Gardner (6 posts)

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

Img_20131109_124437_1_pragsmall
16 Dec 2013, 10:16
Moandji Ezana (3 posts)

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

events.js:72
        throw er; // Unhandled 'error' event
Error: listen EADDRINUSE

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

Avatar_pragsmall
16 Dec 2013, 16:54
Jim R. Wilson (69 posts)

Thanks, that’s a good idea!

Richard mateosian 5x5a_smaller_pragsmall
17 Mar 2014, 15:12
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
Trying 127.0.0.1...
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.

fs.js:1051
    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?

Photo_2_pragsmall
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.

Selfie on 5-6-14 at 11.30 pm s_pragsmall
22 May 2014, 18:08
Aniket Suryavanshi (7 posts)

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

Avatar_pragsmall
26 May 2014, 11:10
Jim R. Wilson (69 posts)

Richard, what OS and node version are you using?

Harrison-cannon_pragsmall
12 Apr 2015, 19:37
harrison cannon (3 posts)

I am having the exact same issue as Richard Mateosian. I am on a macbook pro running OS 10.10.2. Node version 0.10.27. I tried different ports and get the same issue.

fs.js:1051
    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> (/Users/harrisoncannon/projects/node/node the right way/networking/net-watcher.js:24:26)
    at Server.EventEmitter.emit (events.js:95:17)
    at TCP.onconnection (net.js:1191:8)
Harrison-cannon_pragsmall
14 Apr 2015, 12:20
harrison cannon (3 posts)

I figured out why I was getting my error. I didn’t have the target.txt file in my networking folder. I guess it must be watching a file that exists, duh.

  You must be logged in to comment