Re: Server port not released
Esmond Pitt <[email protected]> Tue, 2 Sep 2008 17:48:21 +1000
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Organization | Melbourne Software Company |
| Message-ID | <20080902074640.FCEZ1967.nskntotgx01p.mx.bigpond.com@toshibakx1wgjb> |
Try this:
int port = 10001;
=====> String service = "Pips";
rmi = new RMI();
=====> Registry registry = LocateRegistry.createRegistry(port);
=====> registry.rebind(service, rmi);
Naming.unbind(service);
UnicastRemoteObject.unexportObject(rmi, true);
=====> UnicastRemoteObject.unexportObject(registry, true);
May not work, because the port may still not be released for a while, or
ever. There have been bugs in this area.
But it's a strange design. A port number should be permanently associated
with a protocol. You would really be better off using a separate port for
your ServerSocket.
EJP
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS". For general help, send email to
[email protected] and include in the body of the message "help".
For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html
To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html