Update to latest NetMarshalClient UDP implement.
This commit is contained in:
parent
dccbb7fe14
commit
9773f552e6
@ -147,7 +147,6 @@ public final class Main {
|
|||||||
server = null;
|
server = null;
|
||||||
client = null;
|
client = null;
|
||||||
sslUpgraded = false;
|
sslUpgraded = false;
|
||||||
boolean connectFromServer = false;
|
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case '0':
|
case '0':
|
||||||
sendLoopsRemainingSetting = 1;
|
sendLoopsRemainingSetting = 1;
|
||||||
@ -185,8 +184,7 @@ public final class Main {
|
|||||||
requestSendSettings();
|
requestSendSettings();
|
||||||
try {
|
try {
|
||||||
DatagramSocket socket = new DatagramSocket();
|
DatagramSocket socket = new DatagramSocket();
|
||||||
server = new NetMarshalServer(socket, factory, factory.getPacketLoader(), fragOpts);
|
client = new NetMarshalClient(socket, address, port, factory, factory.getPacketLoader(), fragOpts);
|
||||||
connectFromServer = true;
|
|
||||||
isClient = true;
|
isClient = true;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -207,8 +205,7 @@ public final class Main {
|
|||||||
requestSendSettings();
|
requestSendSettings();
|
||||||
try {
|
try {
|
||||||
DatagramSocket socket = new DatagramSocket(port, address);
|
DatagramSocket socket = new DatagramSocket(port, address);
|
||||||
server = new NetMarshalServer(socket, factory, factory.getPacketLoader(), fragOpts);
|
client = new NetMarshalClient(socket, address, port, factory, factory.getPacketLoader(), fragOpts);
|
||||||
connectFromServer = true;
|
|
||||||
isClient = true;
|
isClient = true;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -262,13 +259,6 @@ public final class Main {
|
|||||||
server.setOpenedConsumer(Main::connectH);
|
server.setOpenedConsumer(Main::connectH);
|
||||||
server.setClosedConsumer(Main::closeH);
|
server.setClosedConsumer(Main::closeH);
|
||||||
server.open();
|
server.open();
|
||||||
if (connectFromServer) {
|
|
||||||
try {
|
|
||||||
server.connect(address, port, 0);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
client.setReceiveExceptionBiConsumer(Main::errH);
|
client.setReceiveExceptionBiConsumer(Main::errH);
|
||||||
|
Loading…
Reference in New Issue
Block a user