mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-21 09:51:50 +00:00
Move test for uninitialised mdp port to throw in more cases
This commit is contained in:
parent
dc0c0f86d8
commit
fbbbfdacc7
@ -66,8 +66,6 @@ public class MdpSocket{
|
||||
bind(SubscriberId.ANY, port);
|
||||
}
|
||||
public synchronized void bind(SubscriberId sid, int port) throws IOException {
|
||||
if (loopbackMdpPort==0)
|
||||
throw new IOException("Loopback MDP port has not been set");
|
||||
if (sid==null)
|
||||
throw new NullPointerException();
|
||||
if (sid.equals(this.sid) && this.port == port)
|
||||
@ -109,6 +107,8 @@ public class MdpSocket{
|
||||
|
||||
public SelectableChannel getChannel() throws IOException {
|
||||
if (channel == null){
|
||||
if (loopbackMdpPort==0)
|
||||
throw new IOException("Loopback MDP port has not been set");
|
||||
channel = DatagramChannel.open();
|
||||
channel.connect(new InetSocketAddress(loopback, loopbackMdpPort));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user