diff --git a/source/doap/client/client.d b/source/doap/client/client.d index 18d3b03..8e8bb4c 100644 --- a/source/doap/client/client.d +++ b/source/doap/client/client.d @@ -60,6 +60,22 @@ public class CoapClient init(); } + /** + * Constructs a new CoAP client to the + * provided endpoint address and port. + * + * This constructor provided name + * resolution on the host part. + * + * Params: + * host = the CoAP host + * port = the CoAP port + */ + this(string host, ushort port) + { + this(new InternetAddress(host, port)); + } + /** * Sets up a new datagram socket, * sets the running status to `true` @@ -241,8 +257,7 @@ version(unittest) */ unittest { - Address addr = new InternetAddress("coap.me", 5683); - CoapClient client = new CoapClient(addr); + CoapClient client = new CoapClient("coap.me", 5683); CoapRequestFuture future = client.newRequestBuilder().payload(cast(ubyte[])"Hello this is Tristan!")