Results 1 to 3 of 3
- 02-20-2009, 08:33 AM #1
Member
- Join Date
- Feb 2009
- Location
- Delhi
- Posts
- 63
- Rep Power
- 0
[SOLVED] problem in socket connection
hello,
i am new in socket programming..
i am trying to run below code but it hangs when i call the accept() method on the serversocket's obj.
Please help me out...Java Code:public class HTTPServer { public static void main ( String a [ ] ) throws Exception { final int httpd = 80; ServerSocket ssock = new ServerSocket ( httpd ) ; System.out.println ( "have opened port 80 locally" ) ; try { Socket sock = ssock.accept ( ) ; System.out.println ( "client has made socket connection" ) ; } catch(java.io.IOException e) { System.out.println("Could establish the connection"); } } }
thanks
/\/
- 02-20-2009, 01:13 PM #2
Any clients out there?
Is there a corresponding client code trying to send something to the posted server code? Your code isn't hung... it's waiting for something to come through the port.
Luck,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 02-20-2009, 01:33 PM #3
Member
- Join Date
- Feb 2009
- Location
- Delhi
- Posts
- 63
- Rep Power
- 0
Similar Threads
-
Software caused connection abort: socket write error
By kuguy in forum NetworkingReplies: 3Last Post: 04-13-2010, 03:43 PM -
problem in socket connection in sending images
By vibhor in forum NetworkingReplies: 2Last Post: 02-20-2009, 05:39 AM -
[SOLVED] Problem with socket programming(Vista)
By jagatsastry in forum NetworkingReplies: 1Last Post: 02-02-2009, 03:56 PM -
Error opening socket: java.net.ConnectException: Connection refused: connect
By somersst in forum Java ServletReplies: 3Last Post: 01-26-2009, 05:30 PM -
How To Make Socket Connection
By madhumurundi in forum NetworkingReplies: 5Last Post: 04-21-2008, 06:05 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks