forked from I2P_Developers/i2p.i2p
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:
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user