-
Notifications
You must be signed in to change notification settings - Fork 174
Replies: 2 comments · 8 replies
-
Can you please provide a few more details. What kind of transport layer is used here, SHM, UDP or TCP? What exactly means 'long time'? |
Beta Was this translation helpful? Give feedback.
All reactions
-
I use tcp for data transfer in different process,'long time' means publisher didn't call it function in about five or six minutes to create message,then call function to send the data but the receiver can't receive the data. The details about ecal.ini
detail about how to transport data
|
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @BoxCharon, thank you for providing more details. You mentioned you use tcp. How did you configure this? In your eCAL config error: to set [publisher/use_tcp] and [publisher/use_udp_mc] both on auto mode (2) is not allowed and stop execution. Besides this. In the current eCAL releases you can configure / force the usage of a specific transport layer using the // force tcp send mode
pub.SetLayerMode(eCAL::TLayer::tlayer_all, eCAL::TLayer::smode_off);
pub.SetLayerMode(eCAL::TLayer::tlayer_tcp, eCAL::TLayer::smode_on); I modified the existing eCAL minimal send sample to send over tcp messages every 5 minutes: int main(int argc, char** argv)
{
std::cout << "-------------------------------" << std::endl;
std::cout << " HELLO WORLD SENDER" << std::endl;
std::cout << "-------------------------------" << std::endl;
// initialize eCAL API
eCAL::Initialize(argc, argv, "minimal_snd");
// publisher for topic "Hello"
eCAL::string::CPublisher<std::string> pub("Hello");
// force tcp send mode
pub.SetLayerMode(eCAL::TLayer::tlayer_all, eCAL::TLayer::smode_off);
pub.SetLayerMode(eCAL::TLayer::tlayer_tcp, eCAL::TLayer::smode_on);
// send updates
int cnt = 0;
while (eCAL::Ok())
{
// build string
std::stringstream snd_content;
snd_content << "Hello World" << " (" << ++cnt << ")";
// send content
pub.Send(snd_content.str(), cnt);
std::cout << "Sent \"" << snd_content.str() << "\"" << std::endl;
// sleep 5 minutes
std::this_thread::sleep_for(std::chrono::minutes(5));
}
// finalize eCAL API
eCAL::Finalize();
return(0);
} It worked well on my machine with no message drops. So if you say during the sender does not send a message for a long time are you sending in a very low frequency like shown in the sample above or do you interrupt the sending node by pausing or debugging it? Important to understand is, that eCAL is exchanging registration information in the background with an 1 Hz frequency. This registration thread should not be interrupted. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @rex-schilasky ,thanks for your help. |
Beta Was this translation helpful? Give feedback.
All reactions
-
@rex-schilasky: I think you missread the ecal.ini. BoxCharon posted the following configuration: [publisher]
use_inproc = 2
use_shm = 2
use_tcp = 2
use_udp_mc = 0 That configuration should to my knowledge be absolutely valid, we even advertise that configuration in the documentation for use-cases where you don't want UDP data transport. However, TCP will not be used, as they also set @BoxCharon: You understood that correctly. I am pretty sure, your issue is the following:
I guess by pausing you also mean pausing the entire process with a debugger etc. If you do that, you will not only halt your own code, but you also stall the ecal-internal registration thread. That thread periodically sends out registration packages to make its topics visible to other nodes. By pausing that thread, other nodes will assume that your process has been terminated and therefore unsubscribe from the data after a certain timeout. You can configure the timeout in the [common]
registration_timeout = 60000 This is the default value |
Beta Was this translation helpful? Give feedback.
All reactions
-
@FlorianReimold, fully correct. I thought tcp and udp were set to auto. One minor correction. The |
Beta Was this translation helpful? Give feedback.
All reactions
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Please create a new discussion instead of hijacking somebody else's. |
Beta Was this translation helpful? Give feedback.
-
When ecal is used to implement inter-process communication, during the sender does not send a message for a long time, and then the receiver cannot receive the message after this time which is sent by the sender.
Beta Was this translation helpful? Give feedback.
All reactions