HandleData() public method

public HandleData ( MemBlock p, ISender from, object state ) : void
p Brunet.Util.MemBlock
from ISender
state object
return void
Esempio n. 1
0
        public void HandleData(MemBlock b, ISender from, object state)
        {
            MemBlock payload = null;
            PType    t       = null;

            try {
                t = PType.Parse(b, out payload);
                if (t.Equals(PType.Protocol.ReqRep))
                {
                    _rrm.HandleData(payload, from, state);
                }
                else if (t.Equals(PType.Protocol.Rpc))
                {
                    Rpc.HandleData(payload, from, state);
                }
            }
            catch (Exception x) {
                Console.Error.WriteLine("Packet Handling Exception: {3}\n\tType: {0}\n\t\n\tFrom: {1}\n\tData: {2}",
                                        t, from, payload.GetString(System.Text.Encoding.ASCII), x);
            }
        }