开发者

Java Socket exception

I开发者_JS百科 am trying to write a simple client server program in Java :- Running both server and client code on the same machine...but while running getting an error :-

java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.(Unknown Source)
        at java.net.Socket.(Unknown Source)
        at Requester.run(Requester.java:13)
        at Requester.main(Requester.java:68)
Exception in thread "main" java.lang.NullPointerException
        at Requester.run(Requester.java:45)
        at Requester.main(Requester.java:68)

Can anyone help!


Is the port you are trying to connect to open? Is there an active firewall that may block the request?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜