mirror of
https://github.com/deavmi/doap
synced 2024-07-02 12:47:44 +02:00
CoapClient
- Added new constructor `this(string host, ushort port)` -This constructor provided name resolution on the host part. Client (unit tests) - Updated unit test to use the new `CoapClient` name-resolution-based constructor
This commit is contained in:
parent
456d8918ee
commit
1e50540e75
|
@ -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!")
|
||||
|
|
Loading…
Reference in New Issue
Block a user