This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I have my server running at port 2000. I tried to make a request to the server by telnet like telnet localhost 2000 but I got an error message saying that a connection could not be extablished to localhost. Could anyone tell me what I'm doing wrong. Thanks, Srinivas
Hi Srinivas, It should work fine. Are you getting an exception on the server when you try to connect? What OS are you using? You might need to look at the code where your ServerSocket accepts the connection. I tested with this code and easily connected thru telnet:
If that works, then the problem is in your server. Hope this helps, Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Joined: Mar 09, 2001
Michael, Here's the code that I wrote. I tested your code and it works fine but this one doesn't. Do you find anything wrong?
Joined: Jan 30, 2002
Hi Srinivas, You didn't start a thread. After creating your Server object try this:
That should do the trick. Hope this helps, Michael Morris