This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "" Watch "" New topic

Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 660

Any idea why I am getting, running both, and, Tried to use telnet to connect to port 4900 on the localhost, however, the connection fails.

Windows Firewall is off on my laptop running WinXP SP3.

Server output - Displayed when running
Inside default ctor
Inside startserver
Inside initialization
Abt to block on select()

Error displayed when running Connection refused: connect
at Method)
at Client.makeConnection(
at Client.main(
Inside SendMessage

Command line

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Jon>telnet localhost 4900
Connecting To localhost...Could not open connection to the host, on port 4900: C
onnect failed

C:\Documents and Settings\Jon>netstat -a

Active Connections

TCP armani:4900 armani:0 LISTENING

Rob Spoor

Joined: Oct 27, 2005
Posts: 19656

If telnet is failing as well then the problem is somewhere in your server. Ignore the client for now.

I've added some println statements but the server appears to hang on the selector().select() method.

How To Ask Questions How To Answer Questions
wood burning stoves
Similar Threads
non blocking socket
NIO Socket weirdnes in Solaris 2.10
server can not accept all the clients connection request
ServerSocketChannel.accept() seems to create a random port to send data to?
java.util.Timer inside Runnable?