Thanks to all who helped. As much as I thought I had both client and
server on the same port, I didn't. My code said I did, but what I
compiled and posted on the webpage didn't. Using telnet and netstat
gave me my first clue. Thanks all!
Michael Sinz wrote:
>
> On Mon, 05 Oct 1998 06:21:19 +0000, Glenn Valenta wrote:
>
> >I'm new to Java and also not too experienced in Linux so forgive me
> >if this is a simple question, but I couldn't find it in the FAQs.
> >
> >When I try to open a network socket, I get...
> >
> > java.net.ConnectException: Connection refused
> >
> >at this line...
> >
> > socket = new Socket("localhost", 8205);
> >
> >I think I may have a permission problem somewhere but I can't even
> >open the socket as root. Any Ideas?
> >
> >Does this sound like a host.allow or host.deny problem?
> >
> >At the moment, I have written a simple client / server app to simply
> >get started in java networking. The problem is with anything that opens
> >a port. I have compiled sample code from a few books and get the same
> >error each time.
> >
> >I'm using jdk 1.1.6 on Redhat 5.1 with the updated lib.
> >
> >I have placed the full source on my Webpage at...
> >
> >http://ouray.cudenver.edu/~gavalent/java/problem1.html
>
> Well, the problem is nothing to do with security given that you are
> running as a full application and are connected via localhost.
>
> The first thing I noticed was that you are not connecting to the same
> port that the server is "servicing". You created the server socket on
> port 4747. You need to connect to that port. I do not know what 8205 is
> since you do not service that port in any of the code you have posted.
>
> Also, just in case of a strange setup - check that you can "ping localhost"
> meaning that your system knows that as a name. (Normally one should
> have that setup but I have run into people who either deleted that definiton
> from their hosts file or never put it in...)
>
> Michael Sinz -- Director of Research & Development, NextBus Inc.
> mailto:[EMAIL PROTECTED] --------- http://www.nextbus.com
> My place on the web ---> http://www.users.fast.net/~michael_sinz
--
Glenn Valenta Engineering @ http://www.coloradostudios.com
[EMAIL PROTECTED] http://ouray.cudenver.edu/~gavalent/
[EMAIL PROTECTED] Personal mail
[EMAIL PROTECTED] Work mail