First off, thank you so much for taking the time help me in this matter. As I said, this problem has been plaguing me for quite sometime. Since you suggested that the problem may be related to the security manager settings I created a .policy file for the Client that looks like:

grant {
permission java.security.AllPermission "", "";
};

I placed the file in the /src folder of the Client application and added the code: -Djava.security.manager -Djava.security.policy=src/SphereCCGClient.policy (is this correct implementation?). When I do this I still get the same connection refused error.

I created another policy file with the same contents and did the same procedure for the Server application. When I do this and start the Server, I start getting Server an exception: java.security.AccessControlException: access denied ("java.net.SocketPermission"...

So I'm not sure what I'm doing wrong with the policy files, however I'm not sure as they are the issue, since when I had none, I did not receive an access denied exception.

I would like to try the example you provided in creating my own sockets, however I run in to an issue when I try to implement the code as shown. In the NotificationClientSocketFactory class, you make several references to 'externalIP', however I can not find where this variable is instantiated for the class. Also can you elaborate a little bit on the call of the client-side, where does the client receive the stub for the class?

One last thing; I've been testing the server and client on the same machine for this, but since I'm trying to connect to the external IP of my server, would testing the client side from an external machine produce different results?

Thanks so much!

CAPTCHA