Help! How do I get Java sockets to work in Windows 2000?

Discussion in 'Java' started by Thundaran, Jan 11, 2006.

  1. Thundaran

    Thundaran Guest

    I'm writing an STMP program that need to connect to an MX server. My
    code works fine from a Unix machine, but I need to run it from Windows:

    InetSocketAddress address = new InetSocketAddress(server,
    25);
    Socket socket = new Socket();
    socket.connect(address, 5000); // connect with 5 second
    timeout

    When I run my java program in the command prompt I get this error
    message.

    java.net.ConnectException: Connection timed out:

    How to I get this socket to work?
    Do I have to create a bridge between a Java Socket and a Windows Socket?
    Thundaran, Jan 11, 2006
    #1
    1. Advertising

  2. Thundaran

    zero Guest

    "Thundaran" <> wrote in
    news::

    > I'm writing an STMP program that need to connect to an MX server. My
    > code works fine from a Unix machine, but I need to run it from Windows:
    >
    > InetSocketAddress address = new InetSocketAddress(server,
    > 25);
    > Socket socket = new Socket();
    > socket.connect(address, 5000); // connect with 5 second
    > timeout
    >
    > When I run my java program in the command prompt I get this error
    > message.
    >
    > java.net.ConnectException: Connection timed out:
    >
    > How to I get this socket to work?
    > Do I have to create a bridge between a Java Socket and a Windows Socket?
    >
    >


    firewall?

    --
    Beware the False Authority Syndrome
    zero, Jan 12, 2006
    #2
    1. Advertising

  3. Thundaran

    Thundaran Guest

    Re: Help! How do I get Java sockets to work in Windows 2000?

    There is no firewall present
    Thundaran, Jan 12, 2006
    #3
  4. Thundaran

    Thundaran Guest

    Re: Help! How do I get Java sockets to work in Windows 2000?

    There is no firewall present
    Thundaran, Jan 12, 2006
    #4
  5. Thundaran

    Thundar Guest

    Re: Help! How do I get Java sockets to work in Windows 2000?

    Windows 2000 doesn't have a firewall
    Thundar, Jan 12, 2006
    #5
  6. Thundaran

    Roedy Green Guest

    Re: Help! How do I get Java sockets to work in Windows 2000?

    On 11 Jan 2006 18:27:53 -0800, "Thundar"
    <> wrote, quoted or indirectly quoted
    someone who said :

    >Windows 2000 doesn't have a firewall


    of course there are a ton of third party ones. See
    http://mindprod.com/jgloss/firewall.html
    And you can get one built in to your router pretty cheaply these days.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Jan 12, 2006
    #6
  7. Thundaran

    Thundar Guest

    Re: Help! How do I get Java sockets to work in Windows 2000?

    I'm trying to get the sockets to work, I dont care about third party
    firewalls. *sigh* I think this is the last time I turn to google msg
    boards for help.
    Thundar, Jan 12, 2006
    #7
  8. Thundaran

    Mel O'Drama Guest

    Re: Help! How do I get Java sockets to work in Windows 2000?

    "Thundar" <> wrote in message
    news:...
    > I'm trying to get the sockets to work, I dont care about third party
    > firewalls. *sigh* I think this is the last time I turn to google msg
    > boards for help.
    >


    Try using telnet to connect to your server from Windows....

    > telnet server 25


    Or just configure your mail client to connect to the server. That at least
    should tell you if there's something other than your code that's stopping
    you reaching the server.
    Mel O'Drama, Jan 12, 2006
    #8
  9. Thundaran

    Guest

    Re: Help! How do I get Java sockets to work in Windows 2000?

    Make sure the host name resolves. Try using just the IP address.
    DNS name lookup or NIS name lookup could be the problem. Using the IP
    address will rule this out.
    Open a cmd window and try pinging the server.

    Run the program and in a seperate cmd window use the command
    netstat -ni|more and look for the server's IP address, the state of the
    socket will show you what is going on with your socket connection.
    , Jan 12, 2006
    #9
  10. Re: Help! How do I get Java sockets to work in Windows 2000?

    "Thundar" <> wrote in message
    news:...
    > I'm trying to get the sockets to work, I dont care about third party
    > firewalls.


    I think what people are trying to say is that connecting maybe a problem on
    the OS level and have nothing to do with your code.

    Grab another mail client not previously installed on the system, run it and
    verify it connects and you will have eliminated the possibility that it is a
    firewall/network/hardware issue and established that the computer is capible
    of connecting to the server.

    Often times you will find that when there cannot possibly be a mistake with
    the piece of code you are trying to fix, that you are right, there isn't a
    mistake with it.


    > *sigh* I think this is the last time I turn to google msg
    > boards for help.


    Try usenet instead, it allows you to quote who you are replying to so people
    don't get confused.

    --
    LTP

    :)
    Luc The Perverse, Jan 12, 2006
    #10
  11. Thundaran

    Roedy Green Guest

    Re: Help! How do I get Java sockets to work in Windows 2000?

    On 11 Jan 2006 19:42:06 -0800, "Thundar"
    <> wrote, quoted or indirectly quoted
    someone who said :

    >I'm trying to get the sockets to work, I dont care about third party
    >firewalls. *sigh* I think this is the last time I turn to google msg
    >boards for help.


    People can't help you if they don't understand your problem. "getting
    sockets to work" is to broad.

    You CAN'T ignore the problem of firewalls when you use sockets. That's
    one reason why they are not more widely used. You can temporarily
    ignore the problem by using a pair of machines on the same LAN without
    a firewall between them.

    This is not a Google message board. This is a newsgroup. Google is
    only one way, and not a very good way, of using it. See
    http://mindprod.com/jgloss/newsgroups.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Jan 12, 2006
    #11
  12. Thundaran

    Nigel Wade Guest

    Re: Help! How do I get Java sockets to work in Windows 2000?

    Thundar wrote:

    > Windows 2000 doesn't have a firewall


    The firewall would be on the SMTP server, or between your W2k client and the
    SMTP server. It's a possibility that the SMTP server has been setup to only
    allow connections from certain clients, and a firewall is one simple way of
    achieving this.

    As someone else suggested, test the connection using telnet.

    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
    Nigel Wade, Jan 12, 2006
    #12
  13. Thundaran

    Alan Krueger Guest

    Re: Help! How do I get Java sockets to work in Windows 2000?

    Thundar wrote:
    > I'm trying to get the sockets to work, I dont care about third party
    > firewalls. *sigh* I think this is the last time I turn to google msg
    > boards for help.


    Usenet is not Google Groups, though Google Groups participates in and
    archives Usenet.
    Alan Krueger, Jan 14, 2006
    #13
    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. Guest
    Replies:
    2
    Views:
    839
    dave wanta
    Jul 11, 2003
  2. =?Utf-8?B?TGU5NTY5?=

    Moving web app from windows 2000 to windows 2003 - Help

    =?Utf-8?B?TGU5NTY5?=, Apr 18, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    350
    =?Utf-8?B?TGU5NTY5?=
    Apr 18, 2005
  3. =?Utf-8?B?TGU5NTY5?=

    Moving web app from windows 2000 to windows 2003 - Help

    =?Utf-8?B?TGU5NTY5?=, Apr 18, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    328
    =?Utf-8?B?TGU5NTY5?=
    Apr 18, 2005
  4. Rico
    Replies:
    2
    Views:
    102
  5. Barry Millman
    Replies:
    16
    Views:
    248
Loading...

Share This Page