Telnetting to diff IP with same port number

Discussion in 'Java' started by tukker, Apr 27, 2010.

  1. tukker

    tukker Guest

    Hi All,
    I am new to JAVA world.
    Is it possible to have a telnet service running and lesion on
    port let say 233, but the telnetd should be able to service for
    multiple IP address.
    For example: telnetd will be configured to serve request for
    1.1.1.1 and 2.2.2.2
    it allways lesion to port 233
    The telnetd should also be able to accept
    2 telnet request with target IP as 1.1.1.1 and 2.2.2.2 on same port
    23.
    Lets assume the telnetd is running on a
    single windows m/c and we have routes added on to saying any telnet
    request with port 233 to IP address 1.1.1.1 or 2.2.2.2. go via
    loopback.


    Thanks in advance
    Sandeep
    tukker, Apr 27, 2010
    #1
    1. Advertising

  2. tukker

    Java coder Guest

    tukker a écrit :
    > Hi All,
    > I am new to JAVA world.
    > Is it possible to have a telnet service running and lesion on
    > port let say 233, but the telnetd should be able to service for
    > multiple IP address.
    > For example: telnetd will be configured to serve request for
    > 1.1.1.1 and 2.2.2.2
    > it allways lesion to port 233
    > The telnetd should also be able to accept
    > 2 telnet request with target IP as 1.1.1.1 and 2.2.2.2 on same port
    > 23.
    > Lets assume the telnetd is running on a
    > single windows m/c and we have routes added on to saying any telnet
    > request with port 233 to IP address 1.1.1.1 or 2.2.2.2. go via
    > loopback.


    httpd is able to listen to several ip on the same computer (i think) if
    you don't bind to any ip. So on your java socket, don't bind to any ip,
    and it should work.
    Java coder, Apr 27, 2010
    #2
    1. Advertising

  3. tukker

    Tom Anderson Guest

    On Tue, 27 Apr 2010, tukker wrote:

    > I am new to JAVA world.
    > Is it possible to have a telnet service running and lesion on
    > port let say 233, but the telnetd should be able to service for
    > multiple IP address.


    Yes. This is the default behaviour of a ServerSocket which doesn't have a
    specified local address. It's also the behaviour of a ServerSocket created
    with an explicit null address, and for that you can rely on the API docs:

    http://java.sun.com/javase/6/docs/a...l#ServerSocket(int, int, java.net.InetAddress)

    The bindAddr argument can be used on a multi-homed host for a
    ServerSocket that will only accept connect requests to one of its
    addresses. If bindAddr is null, it will default accepting connections on
    any/all local addresses.

    It's also the behaviour of a ServerSocket bound to the address 0.0.0.0 (at
    least on my machine - is this portable?). This is useful to know when you
    have an API that absolutely requires a bind address.

    > Lets assume the telnetd is running on a
    > single windows m/c and we have routes added on to saying any telnet
    > request with port 233 to IP address 1.1.1.1 or 2.2.2.2. go via
    > loopback.


    If it's specifically routed via loopback, i think you could even bind to
    127.0.0.1 and receive all the connections.

    tom

    --
    Get my pies out of the oven!
    Tom Anderson, Apr 27, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Howard
    Replies:
    2
    Views:
    511
    GIMME
    Nov 17, 2003
  2. Cyril Vi?ville

    diff Process under diff users

    Cyril Vi?ville, Jun 29, 2004, in forum: Perl
    Replies:
    1
    Views:
    500
    Joe Smith
    Jun 29, 2004
  3. Berrucho
    Replies:
    2
    Views:
    619
    Infant Newbie
    Dec 5, 2003
  4. A Traveler

    Diff CSS styles for diff INPUT TYPE='s?

    A Traveler, Aug 31, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    4,905
    Steve Fulton
    Aug 31, 2004
  5. Peña, Botp

    telnetting cisco routers/devices

    Peña, Botp, Jul 4, 2005, in forum: Ruby
    Replies:
    2
    Views:
    124
    Ghislain Mary
    Jul 4, 2005
Loading...

Share This Page