R
rubikzube*
Hi. I'm trying to specify the local address and port (i.e. network
interface) to use for a URLConnection.
I didn't see any public methods in the documentation for the java.net
package that would allow me to do this.
I tried to debug into the URLConnection to look at how the native
implementation sets the local port and address, but there didn't seem
to be any source available for the concrete classes in
sun.net.www.protocol.http.
I resorted to instantiating my own socket and binding it to the local
address and port that I want, but it's not an ideal proposition
because I have to write my own HTTPRequests.
If anyone knows how to do this without using sockets, I would be
obliged.
I'm using a Mac running 10.4.8 with the 1.5.0 JVM and Eclipse 3.2.2.
interface) to use for a URLConnection.
I didn't see any public methods in the documentation for the java.net
package that would allow me to do this.
I tried to debug into the URLConnection to look at how the native
implementation sets the local port and address, but there didn't seem
to be any source available for the concrete classes in
sun.net.www.protocol.http.
I resorted to instantiating my own socket and binding it to the local
address and port that I want, but it's not an ideal proposition
because I have to write my own HTTPRequests.
If anyone knows how to do this without using sockets, I would be
obliged.
I'm using a Mac running 10.4.8 with the 1.5.0 JVM and Eclipse 3.2.2.