Skip to content

Commit

Permalink
Bugfix: (@webercheng)
Browse files Browse the repository at this point in the history
  • Loading branch information
phuicy committed Sep 18, 2022
1 parent ca8dd90 commit 7798308
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
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

0 comments on commit 7798308

Please sign in to comment.