summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-06-01 15:33:43 +0200
committerMartin Sustrik <sustrik@250bpm.com>2012-06-01 22:29:53 +0200
commitb3875624ba409160da6ad9292b5ec1e1ec5f2bef (patch)
treedff1ec2adaf757e21343a69e464a1a1868ef8c8d
parent9ba8f9a503d69b891fae38628e0038f49ed5b8a4 (diff)
Minor fixed to UDP transport.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
-rw-r--r--src/socket_base.cpp2
-rw-r--r--tests/pubsub_udp.cpp8
2 files changed, 4 insertions, 6 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 389bfbc..b424a5e 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -541,7 +541,7 @@ int xs::socket_base_t::connect (const char *addr_)
// PGM does not support subscription forwarding; ask for all data to be
// sent to this pipe.
bool icanhasall = false;
- if (protocol == "pgm" || protocol == "epgm")
+ if (protocol == "pgm" || protocol == "epgm" || protocol == "udp")
icanhasall = true;
// Attach local end of the pipe to the socket object.
diff --git a/tests/pubsub_udp.cpp b/tests/pubsub_udp.cpp
index e981457..ff2b08b 100644
--- a/tests/pubsub_udp.cpp
+++ b/tests/pubsub_udp.cpp
@@ -37,14 +37,12 @@ int XS_TEST_MAIN ()
assert (rc != -1);
rc = xs_setsockopt (sub, XS_SUBSCRIBE, "", 0);
assert (rc == 0);
+
+ // Just in case there's an delay in lower parts of the network stack.
+ sleep (1);
const char *content = "12345678ABCDEFGH12345678abcdefgh";
- // TODO: Due to a core bug, the first message on a PUB/SUB socket
- // is always lost. For now just send a dummy message.
- rc = xs_send (pub, "", 0, 0);
- assert (rc == 0);
-
// Send a message with two identical parts.
rc = xs_send (pub, content, 32, XS_SNDMORE);
assert (rc == 32);