Add hooks so the new PortMapper lets i2p plugins not fail when the router console is not on port 7657. Also raise an exception when requesting unregistered ports so as to encourage swift adding of the registration hooks when those ports are taken.

This commit is contained in:
dream
2011-12-15 23:36:32 +00:00
parent 51e4003089
commit 212981dfee
3 changed files with 11 additions and 3 deletions

View File

@ -58,7 +58,10 @@ public class PortMapper {
* @return -1 if not registered
*/
public int getPort(String service) {
return getPort(service, -1);
int port = getPort(service, -1);
if(-1==port)
throw new RuntimeException("No port registered for service "+service);
return port;
}
/**