Skip to content

Commit

Permalink
Bind publishers to "::" (-> IPv6) by default to support connections f…
Browse files Browse the repository at this point in the history
…rom both IPv6 and IPv4. (#24)

* Bind publishers to "::" (-> IPv6) by default to support connections from both IPv6 and IPv4.

* Updated version number
  • Loading branch information
FlorianReimold committed Mar 22, 2024
1 parent 8e32cc8 commit c9dc185
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions tcp_pubsub/include/tcp_pubsub/publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ namespace tcp_pubsub
* used for logging.
*
* @param[in] address
* The IP address to bind to. When setting this to "0.0.0.0"
* connections from any IP are accepted.
* The IP address to bind to. When setting this to "::",
* connections from any IPv6 & IPv4 are accepted.
* Tip: use an IPv6 IP here to accept both IPv4 and IPv6
* addresses. If "0.0.0.0" is used, the connections will be
* limited to IPv4 connections.
*
* @param[in] port
* The port to accept connections from. When setting to "0",
Expand All @@ -87,8 +90,9 @@ namespace tcp_pubsub
* port, isRunning() will return false.
*
* When the port can be opened, the Publisher will immediatelly accept
* connections from Subscribers. Whether the Publisher is running can be
* checked with isRunning().
* connections from Subscribers. It is bound to "::", meaning that it will
* accept connections from any IPv6 and IPv4 connection. Whether the
* Publisher is running can be checked with isRunning().
*
* @param[in] executor
* The (global) executor that shall execute the workload and be
Expand Down
2 changes: 1 addition & 1 deletion tcp_pubsub/src/publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace tcp_pubsub
}

Publisher::Publisher(const std::shared_ptr<Executor>& executor, uint16_t port)
: Publisher(executor, "0.0.0.0", port)
: Publisher(executor, "::", port)
{}

Publisher::~Publisher()
Expand Down
2 changes: 1 addition & 1 deletion tcp_pubsub/version.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
set(TCP_PUBSUB_VERSION_MAJOR 1)
set(TCP_PUBSUB_VERSION_MINOR 0)
set(TCP_PUBSUB_VERSION_PATCH 4)
set(TCP_PUBSUB_VERSION_PATCH 5)

0 comments on commit c9dc185

Please sign in to comment.