4.11 port

This commit is contained in:
monsieurgustav
2016-03-29 23:55:47 +02:00
parent c073711dc6
commit f01167bed8
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -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);
}
@@ -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);