I'm using HttpClient-2.0rc2.

I'm testing some code that makes an external URL connection.  I'm
testing it with two possible URLs, but they only differ by the host name
and possibly the specified port.  This is probably just a continuation
of some earlier issues I was having because of my need to install an
alternate socket factory.

One URL uses a raw IP address and a specific port, like
"nn.nn.nn.nn:nn".  When I create the PostMethod with this URL, then get
the URI from the method, and then read the port, I find it's found the
correct port.

However, I have two problems with the other URL.  I first tried it
without a specific port, using the default.  This creates a problem
because my connection eventually fails because I end up using a port
value of "-1".  This is probably because I end up using a block of code
like this:

   method.getHostConfiguration().
    setHost(uri.getHost(), uri.getPort(), newProtocol);

Apparently, the port value in the URI is -1.  I'm not sure how to solve
this.

So, I then tried changing the second URL to include a specific port
number, like "host.net:443".  Strangely enough, this ends up generating
the same error.  I tried stepping the HttpMethodBase constructor (which
I send my URL to), and I found that after it parsed the URI, it didn't
think there was a specified port number.  When I stepped through the
same code with the first URL (using the IP address), it was able to find
the port number.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to