Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Thundaran - 11 Jan 2006 23:00 GMT
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?
zero - 12 Jan 2006 01:09 GMT
> 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:
[quoted text clipped - 12 lines]
> How to I get this socket to work?
> Do I have to create a bridge between a Java Socket and a Windows Socket?

firewall?

Signature

Beware the False Authority Syndrome

Thundaran - 12 Jan 2006 02:15 GMT
There is no firewall present
Thundaran - 12 Jan 2006 02:16 GMT
There is no firewall present
Thundar - 12 Jan 2006 02:27 GMT
Windows 2000 doesn't have a firewall
Roedy Green - 12 Jan 2006 03:09 GMT
On 11 Jan 2006 18:27:53 -0800, "Thundar"
<jschleifer@iis-consulting.com> 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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Thundar - 12 Jan 2006 03:42 GMT
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.
Mel O'Drama - 12 Jan 2006 04:08 GMT
> 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.
hamiltonca@yahoo.com - 12 Jan 2006 04:40 GMT
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.
Luc The Perverse - 12 Jan 2006 05:42 GMT
> 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

:)
Roedy Green - 12 Jan 2006 06:38 GMT
On 11 Jan 2006 19:42:06 -0800, "Thundar"
<jschleifer@iis-consulting.com> 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
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Alan Krueger - 14 Jan 2006 07:27 GMT
> 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.
Nigel Wade - 12 Jan 2006 16:01 GMT
> 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.

Signature

Nigel Wade, System Administrator, Space Plasma Physics Group,
           University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.