我試圖用Java編寫一個簡單的客戶端服務器程序: - 在同一臺機器上運行服務器和客戶端代碼......但在運行得到一個錯誤: -Java Socket技術除外
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)
燦任何人幫助!
你可以發佈你的代碼段, – Pratik 2010-12-20 07:42:24
是的,來代碼會很好,也請正確格式化堆棧跟蹤,它幾乎不可讀。 – 2010-12-20 08:11:31
@Sergey:考慮完成! – 2010-12-20 09:59:44