[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: is Java unsafe to use with Tor?



--- Paolo Palmieri <palmaway@xxxxxx> wrote:
> I'm not sure if you're actually coding the program
> or not. 

Yup. Well, it is just something that I am
experimenting on. 

> If you do, 
> then you should probably have a look at the
> ProxySelector class:
>
http://java.sun.com/javase/6/docs/api/java/net/ProxySelector.html
> 
> You can change the default proxy with setDefault()
> and handle problems 
> with the proxy using connectFailed().

I looked at that, too. At first, it looks like it
causes the same behavior as before. connectFailed()
only tells you something failed, it doesn't give you
anything to control on the connection itself (such as
to tell it to quit trying, or something else useful).
As soon as connectFailed() returns, the connection
immediately tries again on the next proxy, or direct
if there aren't any more to try, even if your select()
didn't include a direct connect item in the list it
returned (strange behavior again!) 

A really ugly hack I tried is to throw a
RuntimeException in connectFailed(). That seems to
shut things up pretty good, and the connection does
not automatically retry. I'd rather do something more
specific (a RuntimeException from trying to open a
connection? that's so *ugly*!), but the abstract
connectFailed() doesn't give anything more useful to
make things fail nicely. 

> Hope this helps,

Yes. Thanks. 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com