views:

15

answers:

1

Hello, I'm somewhat new to java applet programming and am maintaining someone else's applet. The signed applet records some voice and then uploads the file. In the upload, we sometimes get one of these exceptions(SocketException, ConnectException, even UnknownHostException). We trap them, and then report them via a Javascript call from the applet. The javascript call runs fine, which to me indicates that the connection is OK. How can it be that the applet can't open a socket or can't connect but there are no issues w/ the browser connecting?

The applet is signed and does have network access. This happens very occasionally.

Thanks

A: 

Javascript runs in the browser and it uses a connection of its own if it engages with the server. So that's irrelevant. If the applet got a ConnectException there is no connection to be OK, and if you get any IOException other than SocketTimeoutException the connection is hosed and not OK, no two ways about it, and nothing you can do except close the socket and start again.

EJP
Thanks. What I meant by "connection is OK" is that the network and server are both fine, so I'm not sure why the applet can't establish the connection. I'm not too familiar with the networking stack - what would cause a connection failure for the applet while the browser has no such issues?
LeftHem