File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with socket connecting??

 
Tom Barns
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I'm new to this ,but that's what I'm trying to do and what's I'm getting.
I'm trying to create socket connection to another server.
I'm trying to pass domain name according to my code and to get the Ip address and other information for that site.
I'm getting this error:
method not implemented
invalid method in request sportszone.com
I think there is problem with the registered domain that i'm passing to my program.
here is the source code for my program.
thanks alot for your time.


I added the ubb code tag for easier reading How to use ubb codes can be found at http://www.javaranch.com/ubb/ubbcode.html
[This message has been edited by Carl Trusiak (edited March 12, 2001).]
 
Carl Trusiak
Sheriff
Posts: 3340
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I need a little more information to assist you, What is the goal of this application? Is 172.1.87.102 an HTTP server or is it a proxy server?
 
Tom Barns
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.
the server is http server,honestly i'm not sure.
I'm trying to pass a domain name as sports.com and get information about that site.
actually my program is from a java book and i just type it.
thanks again.
 
Carl Trusiak
Sheriff
Posts: 3340
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The example must be showing how to connect through a proxy server. sports.com's ip address is 216.33.113.64 Read the example carefully to figure out what is going on.
 
Rahul Rathore
Ranch Hand
Posts: 324
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
method not implemented
invalid method in request sportszone.com

Tom
I think you have mistyped something or left out some line in the code. Otherwise the mistake/error may be in the book example itself. Things would become clearer only by understanding the context/explanation given in the book, pertaining to the code.
I think I can explain the error message. You are opening a socket to an http server. The methods that an http server recognizes are GET, POST, HEAD etc. (read the http protocol).
However, if you read your example carefully, in the socket that you have opened, you are only passing the string "sportszone.com", but sportszone.com is NOT any method of http. It is for this reason that you are receiving the response from the http server
method not implemented
invalid method in request sportszone.com

In fact either because of mistake in the book, or mistake in your copying, some line may have been left out which prefixes the appropriate method (GET/POST etc). The string "sportszone.com" has then to be appended as a parameter to some GET/POST request.
 
Jamshed Dastur
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
in the constructor of your socket
try passing the ip address of your server as a "string"
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic