aboutsummaryrefslogtreecommitdiffstats
path: root/src/EtiReader.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2023-11-02 11:57:40 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2023-11-02 13:56:18 +0100
commit0d7550715db39408a82d268026b711f454fef2f8 (patch)
tree4ab1d5fd9d1c61d37b5d174d70d6654001b0e6e2 /src/EtiReader.cpp
parentc2467d222ec08ddc4c6f79ea01773496090f809f (diff)
downloaddabmod-0d7550715db39408a82d268026b711f454fef2f8.tar.gz
dabmod-0d7550715db39408a82d268026b711f454fef2f8.tar.bz2
dabmod-0d7550715db39408a82d268026b711f454fef2f8.zip
Add edi_source RC param
Diffstat (limited to 'src/EtiReader.cpp')
-rw-r--r--src/EtiReader.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/EtiReader.cpp b/src/EtiReader.cpp
index 244cc18..eda2f23 100644
--- a/src/EtiReader.cpp
+++ b/src/EtiReader.cpp
@@ -540,8 +540,8 @@ void EdiTransport::Open(const std::string& uri)
{
etiLog.level(info) << "Opening EDI :" << uri;
- const string proto = uri.substr(0, 3);
- if (proto == "udp") {
+ const string proto = uri.substr(0, 6);
+ if (proto == "udp://") {
if (m_proto == Proto::TCP) {
throw std::invalid_argument("Cannot specify both TCP and UDP urls");
}
@@ -571,7 +571,7 @@ void EdiTransport::Open(const std::string& uri)
m_proto = Proto::UDP;
m_enabled = true;
}
- else if (proto == "tcp") {
+ else if (proto == "tcp://") {
if (m_proto != Proto::Unspecified) {
throw std::invalid_argument("Cannot call Open several times with TCP");
}
@@ -582,10 +582,11 @@ void EdiTransport::Open(const std::string& uri)
}
m_port = std::stoi(uri.substr(found_port+1));
- const std::string hostname = uri.substr(6, found_port-6);// skip tcp://
+ const std::string hostname = uri.substr(6, found_port-6);
etiLog.level(info) << "EDI TCP connect to " << hostname << ":" << m_port;
+ m_tcp_uri = uri;
m_tcpclient.connect(hostname, m_port);
m_proto = Proto::TCP;
m_enabled = true;