mirror of
https://github.com/deavmi/doap
synced 2024-07-04 15:50:15 +02:00
- Refactored packaging
- Removed now-completed TODO
This commit is contained in:
parent
42471e21d1
commit
c438c6c78c
|
@ -1,8 +1,7 @@
|
|||
module doap.client.client;
|
||||
|
||||
import std.socket : Socket, Address, SocketType, ProtocolType, getAddress, parseAddress, InternetAddress, SocketShutdown;
|
||||
import doap.client.messaging : CoapMessagingLayer;
|
||||
import doap.client.mesglayer : CoapMessagingLayerFR;
|
||||
import doap.client.messaging;
|
||||
import doap.protocol;
|
||||
import doap.client.request : CoapRequestBuilder, CoapRequest, CoapRequestFuture;
|
||||
import core.sync.mutex : Mutex;
|
||||
|
@ -29,7 +28,7 @@ public class CoapClient
|
|||
* The messaging layer which provides
|
||||
* request-response message match-ups
|
||||
*/
|
||||
private CoapMessagingLayerFR messaging;
|
||||
private CoapMessagingLayer messaging;
|
||||
|
||||
/**
|
||||
* The request-response match list
|
||||
|
@ -56,7 +55,9 @@ public class CoapClient
|
|||
this(Address address)
|
||||
{
|
||||
this.address = address;
|
||||
this.messaging = new CoapMessagingLayer(this); //UDP transport
|
||||
|
||||
import doap.client.messaging.udp : UDPMessaging;
|
||||
this.messaging = new UDPMessaging(this); //UDP transport
|
||||
|
||||
this.requestsLock = new Mutex();
|
||||
this.watcherSignal = new Condition(this.requestsLock);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
module doap.client.mesglayer;
|
||||
module doap.client.messaging.core;
|
||||
|
||||
import doap.client.client : CoapClient;
|
||||
import std.socket : Address;
|
||||
import doap.protocol.packet : CoapPacket;
|
||||
|
||||
public abstract class CoapMessagingLayerFR
|
||||
public abstract class CoapMessagingLayer
|
||||
{
|
||||
/**
|
||||
* The client
|
3
source/doap/client/messaging/package.d
Normal file
3
source/doap/client/messaging/package.d
Normal file
|
@ -0,0 +1,3 @@
|
|||
module doap.client.messaging;
|
||||
|
||||
public import doap.client.messaging.core : CoapMessagingLayer;
|
|
@ -1,4 +1,4 @@
|
|||
module doap.client.messaging;
|
||||
module doap.client.messaging.udp;
|
||||
|
||||
import doap.client.client : CoapClient;
|
||||
import core.thread : Thread;
|
||||
|
@ -15,19 +15,15 @@ import std.socket : Address;
|
|||
|
||||
import std.socket : Socket, Address, SocketType, ProtocolType, getAddress, parseAddress, InternetAddress, SocketShutdown;
|
||||
|
||||
import doap.client.mesglayer : CoapMessagingLayerFR;
|
||||
|
||||
// TODO: Generalize this and then make
|
||||
// ... a UDP version of it
|
||||
import doap.client.messaging;
|
||||
|
||||
/**
|
||||
* Stateful management of responses for
|
||||
* previously made requests.
|
||||
* UDP-based messaging layer
|
||||
*
|
||||
* Handles the actual sending and receiving
|
||||
* of datagrams and fulfilling of requests
|
||||
*/
|
||||
public class CoapMessagingLayer : CoapMessagingLayerFR
|
||||
public class UDPMessaging : CoapMessagingLayer
|
||||
{
|
||||
/**
|
||||
* Reading-loop thread
|
Loading…
Reference in New Issue
Block a user