Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)