• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with socket connecting??

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
in the constructor of your socket
try passing the ip address of your server as a "string"
 
A teeny tiny vulgar attempt to get you to buy our stuff
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic