view 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 source

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);
}