This content has been marked as final. Show 2 replies
"connection refused" mean no server is listening on that port.
telnet localhost 1055
ad you should get the same thing.
I am trying to program a Web server for study. My
file compiles and appears to work but I am getting
refused the connection. I'm on an OS X box
(unix/mac). I am using ports above 1024 and I have
tried logging in as root. I still get this
exception. The parameters passed are host port, or
localhost 1055 or some other number above 1024. Can
-- thanks ahead of time
here is the exception:
java Connect localhost 1055 java.net.ConnectException: Connection refused java.net.ConnectException: Connection refused at at java.net.PlainSocketImpl.socketConnect(Native ative Method) at at at at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.jav a:305) at at at at java.net.PlainSocketImpl.connectToAddress(PlainSocketI mpl.java:171) at at at at java.net.PlainSocketImpl.connect(PlainSocketImpl.java: 158) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at java.net.Socket.<init>(Socket.java:309) at java.net.Socket.<init>(Socket.java:124) at Connect.main(Connect.java:32)