From 0fb0149d9dda2a1da519f782155176004d73c9a1 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Fri, 22 Sep 2023 16:56:48 +0200 Subject: [PATCH] CoapClient - Made `address` package-accessible CoapMessagingLayer - Added `getEndpointAddress()` which returns the associated `CoapClient`'s address --- source/doap/client/client.d | 2 +- source/doap/client/messaging.d | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/doap/client/client.d b/source/doap/client/client.d index 35a7c83..6f0d78d 100644 --- a/source/doap/client/client.d +++ b/source/doap/client/client.d @@ -17,7 +17,7 @@ public class CoapClient /** * CoAP server endpoint */ - private Address address; + package Address address; /** * Running status diff --git a/source/doap/client/messaging.d b/source/doap/client/messaging.d index f27f1fa..2c13d70 100644 --- a/source/doap/client/messaging.d +++ b/source/doap/client/messaging.d @@ -11,6 +11,7 @@ import doap.client.request : CoapRequest; import std.stdio; import std.socket : Socket, SocketSet; +import std.socket : Address; // TODO: Generalize this and then make // ... a UDP version of it @@ -42,6 +43,11 @@ class CoapMessagingLayer : Thread this.client = client; } + public final Address getEndpointAddress() + { + return this.client.address; + } + /** * Reading loop which reads datagrams * from the socket