From f01167bed8f39df80831ee9ace50c4d658baef0b Mon Sep 17 00:00:00 2001 From: monsieurgustav Date: Tue, 29 Mar 2016 23:55:47 +0200 Subject: [PATCH] 4.11 port --- OSC/Source/OSC/Private/OscSettings.cpp | 2 +- OSC/Source/OSC/Private/Receive/OscDispatcher.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OSC/Source/OSC/Private/OscSettings.cpp b/OSC/Source/OSC/Private/OscSettings.cpp index c8d2559..0578c0b 100644 --- a/OSC/Source/OSC/Private/OscSettings.cpp +++ b/OSC/Source/OSC/Private/OscSettings.cpp @@ -55,7 +55,7 @@ int32 UOscSettings::AddSendTarget(const FString & ip_port) uint32_t port; if(Parse(ip_port, &address, &port) && address != FIPv4Address::Any) { - target->SetIp(address.GetValue()); + target->SetIp(address.Value); target->SetPort(port); UE_LOG(LogOSC, Display, TEXT("Send target added: %s"), *ip_port); } diff --git a/OSC/Source/OSC/Private/Receive/OscDispatcher.cpp b/OSC/Source/OSC/Private/Receive/OscDispatcher.cpp index f2d4437..4988f05 100644 --- a/OSC/Source/OSC/Private/Receive/OscDispatcher.cpp +++ b/OSC/Source/OSC/Private/Receive/OscDispatcher.cpp @@ -47,6 +47,7 @@ void UOscDispatcher::Listen(FIPv4Address address, uint32_t port) { _socketReceiver = new FUdpSocketReceiver(_socket, FTimespan::FromMilliseconds(100), TEXT("OSCListener")); _socketReceiver->OnDataReceived().BindUObject(this, &UOscDispatcher::Callback); + _socketReceiver->Start(); _listening = std::make_pair(address, port); UE_LOG(LogOSC, Display, TEXT("Listen to port %d"), port); @@ -179,11 +180,11 @@ void UOscDispatcher::Callback(const FArrayReaderPtr& data, const FIPv4Endpoint& if(packet.IsBundle()) { - SendBundle(_pendingMessages, osc::ReceivedBundle(packet), endpoint.GetAddress()); + SendBundle(_pendingMessages, osc::ReceivedBundle(packet), endpoint.Address); } else { - SendMessage(_pendingMessages, osc::ReceivedMessage(packet), endpoint.GetAddress()); + SendMessage(_pendingMessages, osc::ReceivedMessage(packet), endpoint.Address); } // Set a single callback in the main thread per frame. @@ -221,7 +222,7 @@ void UOscDispatcher::CallbackMainThread() while(_pendingMessages.Dequeue(message)) { const FIPv4Address & senderIp = std::get<2>(message); - FString senderIpStr = FString::Printf(TEXT("%i.%i.%i.%i"), senderIp.GetByte(3), senderIp.GetByte(2), senderIp.GetByte(1), senderIp.GetByte(0)); + FString senderIpStr = FString::Printf(TEXT("%i.%i.%i.%i"), senderIp.A, senderIp.B, senderIp.C, senderIp.D); for(auto receiver : _receivers) { receiver->SendEvent(std::get<0>(message), std::get<1>(message), senderIpStr);