Description

This a repost of a question that I posted to ue5help but it got closed before I got an answer. I am open to making the changes I've requested here and sending them back if that will expedite things.

 

------

 

I'm using the TcpMessaging module to add some endpoints to a message bridge, which I then publish a message to. The issue I'm having is that after calling ITcpMessagingModule::AddOutgoingConnection() some time is needed for the connection to be established before Publish() is called. If Publish is called too early, the message won't get delivered to that endpoint.

 

TcpMessageTransport.cpp

  1. if (Recipients.Num() == 0)
  2. {{{}}
  3. // broadcast the message to all valid connections
  4. RecipientConnections = Connections.FilterByPredicate([&](const TSharedPtr<FTcpMessageTransportConnection>& Connection) -> bool
  5. {{{}}
  6. return Connection->GetConnectionState() == FTcpMessageTransportConnection::STATE_Connected;
  7. });
  8. }

 

Would you guys be able to add some way to verify that the connection has gone through? Locally I've fixed this by adding a function to ITcpMessagingModule called "IsConnectedTo", which checks if a string endpoint is connected. This is plumbed down to the FTcpMessageTransport which checks its private Connections array.

 

Edit:

Would it also be possible to allow some way to modify the TcpMessagingModule's listen endpoint at runtime? This would allow me to automatically set it without the user have to to come up with the "-TcpMessagingListen=" argument. Using the config fallback doesn't quite workite work because it doesn't let you specify the current host ip.

 

Edit 2:

Similar to the above, would it possible to not have to provide the "-Messaging" arg either? The UdpMessaging module uses a config value for this (see FUdpMessagingModule::IsSupportEnabled) whereas TcpMessaging relies on the commandline arg.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-148867 in the post.

2
Login to Vote

Backlogged
CreatedApr 12, 2022
UpdatedMay 1, 2024
View Jira Issue