mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 02:39:44 +00:00
Allow Java mdp protocols to specify the port to listen on
This commit is contained in:
parent
2c72875508
commit
12c02255a1
@ -13,8 +13,11 @@ public abstract class AbstractMdpProtocol<T> extends ChannelSelector.Handler {
|
||||
protected final AsyncResult<T> results;
|
||||
|
||||
public AbstractMdpProtocol(ChannelSelector selector, int loopbackMdpPort, AsyncResult<T> results) throws IOException {
|
||||
this(selector, loopbackMdpPort, results, 0);
|
||||
}
|
||||
public AbstractMdpProtocol(ChannelSelector selector, int loopbackMdpPort, AsyncResult<T> results, int port) throws IOException {
|
||||
this.socket = new MdpSocket(loopbackMdpPort);
|
||||
socket.bind();
|
||||
socket.bind(port);
|
||||
this.selector = selector;
|
||||
this.results = results;
|
||||
selector.register(this);
|
||||
|
@ -31,6 +31,10 @@ public class ServerControl {
|
||||
return this.execPath;
|
||||
}
|
||||
|
||||
public int getLoopbackMdpPort() {
|
||||
return loopbackMdpPort;
|
||||
}
|
||||
|
||||
private void setStatus(ServalDCommand.Status result){
|
||||
loopbackMdpPort = result.mdpInetPort;
|
||||
pid = result.pid;
|
||||
|
Loading…
Reference in New Issue
Block a user