Mercurial > projects > dreactor
annotate dreactor/protocol/Protocol.d @ 11:5836613d16ac
reorg! reorg!
author | rick@minifunk |
---|---|
date | Tue, 12 Aug 2008 16:59:56 -0400 |
parents | |
children |
rev | line source |
---|---|
11 | 1 module dreactor.protocol.IProtocol; |
2 | |
3 struct Message | |
4 { | |
5 public | |
6 int type; | |
7 int errorcode; | |
8 Object payload; | |
9 static Message opCall(Object buf, int t, int e) | |
10 { | |
11 Message m; | |
12 m.type = t; | |
13 errorcode = e; | |
14 m.payload = buf; | |
15 return m; | |
16 } | |
17 } | |
18 | |
19 interface IProtocol | |
20 { | |
21 Message handleRead(Conduit c); | |
22 Message handleWrite(Conduit c); | |
23 Message handleError(Conduit c); | |
24 Message handleConnect(Conduit c); | |
25 Message handleDisconnect(Conduit c); | |
26 } |