Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6184085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:28:31+00:00 2026-05-24T01:28:31+00:00

I have the following node.js server running on 172.16.1.218: var net=require(‘net’); var server =

  • 0

I have the following node.js server running on 172.16.1.218:

var net=require('net');

var server = net.createServer(function (socket) {
        socket.write("Echo server\r\n");
        socket.pipe(socket);
});
server.listen(6001, "172.16.1.218");

I can telnet into it and it echos as expected.

I have the following node.js server running on 172.16.1.224:

var net = require('net');

var server = net.createServer(function (socket) {

  // Every time someone connects, tell them hello and then close the connection.
  socket.addListener("connect", function () {
    sys.puts("Connection from " + socket.remoteAddress);
    socket.end("Hello World\n");
  });

});

// Fire up the server bound to port 7000 on localhost
server.listen(6001,"172.16.1.218");

But when I try to run it, I get the following error:

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: EADDRNOTAVAIL, Cannot assign requested address
    at Server._doListen (net.js:1100:5)
    at net.js:1071:14
    at Object.lookup (dns.js:159:5)
    at Server.listen (net.js:1065:20)
    at Object.<anonymous> (/home/hynese/Desktop/test.js:16:8)
    at Module._compile (module.js:402:26)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at Array.<anonymous> (module.js:421:10)

I’ve turned off all firewalls, etc. I can’t make any sense of this error. Hoping someone can help.

Many thanks in advance,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:28:32+00:00Added an answer on May 24, 2026 at 1:28 am

    On 172.16.1.224 you cannot listen on 172.16.1.218 because that’s not the IP of the machine you’re listening on.

    If you want to listen on that machine, use:

    server.listen(6001,"172.16.1.224");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have the following code: var net = require('net'); var server = net.createServer(function (stream)
in socket.io 0.6, i have following example code: var io = require('/usr/lib/node_modules/socket.io'); var server
I have the following simple http server using Node.js: var http = require('http'); var
I have the following node.js server set up listening to port 9001 var https
I am using socket.io to connect to my node server using the following script:
I'm building my node.js app which has the following structure: server.js controllers/user.js server.js require
I have the following in my node server using Express (truncated to the important
I have the following HTML node structure: <div id=foo> <div id=bar></div> <div id=baz> <div
I need to have following attribute value in my XML node: CommandLine=copy $(TargetPath) ..\..\&#x0D;&#x0A;echo
I have the following input: <node TEXT=txt> <node TEXT=txt> <node TEXT=txt/> <node TEXT=txt/> </node>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.