From 6ca4da2e2371368ab71d008d19bd410c5ed5e6f1 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 14 Jun 2019 12:40:38 +0200 Subject: [PATCH] For UDP, prep channel for messages pre-connection happens first --- .../remote/RegistrationRemoteHandlerClientUDP.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dorkbox/network/connection/registration/remote/RegistrationRemoteHandlerClientUDP.java b/src/dorkbox/network/connection/registration/remote/RegistrationRemoteHandlerClientUDP.java index 36d7de44..fa67196a 100644 --- a/src/dorkbox/network/connection/registration/remote/RegistrationRemoteHandlerClientUDP.java +++ b/src/dorkbox/network/connection/registration/remote/RegistrationRemoteHandlerClientUDP.java @@ -45,6 +45,10 @@ class RegistrationRemoteHandlerClientUDP extends RegistrationRemoteHandlerClient Channel channel = context.channel(); + // have to add a way for us to store messages in case the remote end calls "onConnect()" and sends messages before we are ready. + // note: UDP channels are also unique (just like TCP channels) because of the SessionManager we added + prepChannelForOutOfOrderMessages(channel); + InetSocketAddress udpRemoteAddress = (InetSocketAddress) channel.remoteAddress(); if (udpRemoteAddress != null) { Registration outboundRegister = new Registration(0); @@ -97,10 +101,6 @@ class RegistrationRemoteHandlerClientUDP extends RegistrationRemoteHandlerClient // in the event that we start with a TCP channel first, we still have to set the UDP channel metaChannel.udpChannel = channel; - - // have to add a way for us to store messages in case the remote end calls "onConnect()" and sends messages before we are ready. - // note: UDP channels are also unique (just like TCP channels) because of the SessionManager we added - prepChannelForOutOfOrderMessages(channel); } readClient(channel, registration, "UDP client", metaChannel);