summaryrefslogtreecommitdiffstats
path: root/src/dabOutput/dabOutputTcp.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-10 11:39:25 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-10 11:39:25 +0200
commit2e71bf974f42cfe9edf9c8289602eec0c7ecadf9 (patch)
tree574bd00266dacf3dc7b21d6f601131c85340663b /src/dabOutput/dabOutputTcp.cpp
parentbbafa23de92eb542f4c8266d484aed9faf88d360 (diff)
parent4576c71f10dc009ce0dd9aedbc2f81a3e1a8be0e (diff)
downloaddabmux-2e71bf974f42cfe9edf9c8289602eec0c7ecadf9.tar.gz
dabmux-2e71bf974f42cfe9edf9c8289602eec0c7ecadf9.tar.bz2
dabmux-2e71bf974f42cfe9edf9c8289602eec0c7ecadf9.zip
Merge next into servicelinking
Diffstat (limited to 'src/dabOutput/dabOutputTcp.cpp')
-rw-r--r--src/dabOutput/dabOutputTcp.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dabOutput/dabOutputTcp.cpp b/src/dabOutput/dabOutputTcp.cpp
index 2c5a067..8696bec 100644
--- a/src/dabOutput/dabOutputTcp.cpp
+++ b/src/dabOutput/dabOutputTcp.cpp
@@ -128,9 +128,14 @@ class TCPDataDispatcher
void process(long) {
m_listener_socket.listen();
+ const int timeout_ms = 1000;
+
while (m_running) {
// Add a new TCPConnection to the list, constructing it from the client socket
- m_connections.emplace(m_connections.begin(), m_listener_socket.accept());
+ auto optional_sock = m_listener_socket.accept(timeout_ms);
+ if (optional_sock) {
+ m_connections.emplace(m_connections.begin(), std::move(*optional_sock));
+ }
}
}
@@ -191,6 +196,8 @@ int DabOutputTcp::Open(const char* name)
string address;
bool success = parse_uri(name, &port, address);
+ uri_ = name;
+
if (success) {
dispatcher_ = new TCPDataDispatcher();
try {