This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes problem with socket connecting?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "problem with socket connecting??" Watch "problem with socket connecting??" New topic
Author

problem with socket connecting??

Tom Barns
Ranch Hand

Joined: Oct 27, 2000
Posts: 138
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).]


Thanks for your help.
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
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?

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Tom Barns
Ranch Hand

Joined: Oct 27, 2000
Posts: 138
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

Joined: Jun 13, 2000
Posts: 3340
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

Joined: Sep 30, 2000
Posts: 324
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

Joined: Mar 19, 2001
Posts: 7
hi
in the constructor of your socket
try passing the ip address of your server as a "string"
 
jQuery in Action, 2nd edition
 
subject: problem with socket connecting??
 
Similar Threads
File Transfer via Sockets
Problem with Whois port on the InterNIC Server
nested for loop
Sockets having identical port number
Please help with BufferReader.read()