diff dreactor/protocol/Protocol.d @ 11:5836613d16ac

reorg! reorg!
author rick@minifunk
date Tue, 12 Aug 2008 16:59:56 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dreactor/protocol/Protocol.d	Tue Aug 12 16:59:56 2008 -0400
@@ -0,0 +1,26 @@
+module dreactor.protocol.IProtocol;
+
+struct Message
+{
+public
+    int type;
+    int errorcode;
+    Object payload;
+    static Message opCall(Object buf, int t, int e) 
+    {
+        Message m; 
+        m.type = t; 
+        errorcode = e; 
+        m.payload = buf; 
+        return m;
+    }
+}
+
+interface IProtocol
+{
+   Message handleRead(Conduit c);
+   Message handleWrite(Conduit c);
+   Message handleError(Conduit c);
+   Message handleConnect(Conduit c);
+   Message handleDisconnect(Conduit c);
+}