Fixed logic with local-channel XOR network-channel. Cleaned up logger
access
This commit is contained in:
parent
b64ca30fc7
commit
c44dd03587
@ -18,8 +18,6 @@ package dorkbox.network;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
|
|
||||||
import dorkbox.network.connection.BootstrapWrapper;
|
import dorkbox.network.connection.BootstrapWrapper;
|
||||||
import dorkbox.network.connection.Connection;
|
import dorkbox.network.connection.Connection;
|
||||||
import dorkbox.network.connection.EndPointBase;
|
import dorkbox.network.connection.EndPointBase;
|
||||||
@ -59,7 +57,7 @@ import io.netty.util.internal.PlatformDependent;
|
|||||||
* The client is both SYNC and ASYNC. It starts off SYNC (blocks thread until it's done), then once it's connected to the server, it's
|
* The client is both SYNC and ASYNC. It starts off SYNC (blocks thread until it's done), then once it's connected to the server, it's
|
||||||
* ASYNC.
|
* ASYNC.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings({"unused", "WeakerAccess"})
|
||||||
public
|
public
|
||||||
class Client<C extends Connection> extends EndPointClient<C> implements Connection {
|
class Client<C extends Connection> extends EndPointClient<C> implements Connection {
|
||||||
/**
|
/**
|
||||||
@ -100,11 +98,12 @@ class Client<C extends Connection> extends EndPointClient<C> implements Connecti
|
|||||||
|
|
||||||
String threadName = Client.class.getSimpleName();
|
String threadName = Client.class.getSimpleName();
|
||||||
|
|
||||||
Logger logger2 = this.logger;
|
boolean hostConfigured = (config.tcpPort > 0 || config.udpPort > 0) && config.host != null;
|
||||||
if (config.localChannelName != null && (config.tcpPort > 0 || config.udpPort > 0 || config.host != null) ||
|
boolean isLocalChannel = config.localChannelName != null;
|
||||||
config.localChannelName == null && (config.tcpPort == 0 || config.udpPort == 0 || config.host == null)) {
|
|
||||||
String msg = threadName + " Local channel use and TCP/UDP use are MUTUALLY exclusive. Unable to determine intent.";
|
if (isLocalChannel && hostConfigured) {
|
||||||
logger2.error(msg);
|
String msg = threadName + " Local channel use and TCP/UDP use are MUTUALLY exclusive. Unable to determine what to do.";
|
||||||
|
logger.error(msg);
|
||||||
throw new IllegalArgumentException(msg);
|
throw new IllegalArgumentException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,7 +286,6 @@ class Client<C extends Connection> extends EndPointClient<C> implements Connecti
|
|||||||
}
|
}
|
||||||
|
|
||||||
// have to start the registration process
|
// have to start the registration process
|
||||||
this.connectingBootstrap.set(0);
|
|
||||||
registerNextProtocol();
|
registerNextProtocol();
|
||||||
|
|
||||||
// have to BLOCK
|
// have to BLOCK
|
||||||
|
Loading…
Reference in New Issue
Block a user