Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

First attempt at opening a socket, what is wrong?  RSS feed

 
Rory Lynch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just made my first attempt at opening a socket.
I read the basic theory, seemed straight forward.
I wrote some code, following an example from Just Java 2 book.

here is the code;


command is....
java AskTime ptbtime1.ptb.de

the output is......
"could not create socket for io reason."

I put all the try catch blocks in after it did not work the first time to try and narrow down the problem, but no such luck.
Can anyone point me in the right direction?

thanks
Rory
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that machine is listening on port 13? It doesn't seem to do that.
 
Tarek Khojah
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's why you use printStackTrace() instead of your custom error messages.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!