Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void UROSIntegrationGameInstance::Init()
if (!bTimerSet)
{
bTimerSet = true;
GetTimerManager().SetTimer(TimerHandle_CheckHealth, this, &UROSIntegrationGameInstance::CheckROSBridgeHealth, 1.0f, true, 5.0f);
GetTimerManager().SetTimer(TimerHandle_CheckHealth, this, &UROSIntegrationGameInstance::CheckROSBridgeHealth, 5.0f, true, 5.0f);
}

if (bIsConnected)
Expand Down
14 changes: 12 additions & 2 deletions Source/ROSIntegration/Private/rosbridge2cpp/TCPConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ bool TCPConnection::Init(std::string ip_addr, int port)
std::cout << "Unable to set requested receiver buffer size" << std::endl;
}*/

if (!_sock->Connect(*addr))
bool bConnected = false;
_sock->SetNonBlocking(true);
bConnected = _sock->Connect(*addr);
_sock->SetNonBlocking(false);
// If using _sock->Wait also blocks
if (bConnected ) //&& _sock->Wait(ESocketWaitConditions::WaitForWrite, FTimespan::FromSeconds(2)))
{
// do nothing
}
else
{
return false;

}
// Setting up the receiver thread
UE_LOG(LogROS, Display, TEXT("Setting up receiver thread ..."));

Expand Down