Exemplo n.º 1
0
            public void process()
            {
                int  seq   = transport.BeginRead();
                byte cmdid = (byte)(Packers.Int8.unpack(transport));

                transport.BeginWrite(seq);

                try {
                    switch (cmdid)
                    {
                    case CMD_INVOKE:
                        processInvoke(seq);
                        break;

                    case CMD_DECREF:
                        processDecref(seq);
                        break;

                    case CMD_INCREF:
                        processIncref(seq);
                        break;

                    case CMD_GETINFO:
                        processGetInfo(seq);
                        break;

                    case CMD_PING:
                        processPing(seq);
                        break;

                    case CMD_QUIT:
                        processQuit(seq);
                        break;

                    default:
                        throw new ProtocolError("unknown command code: " + cmdid);
                    }
                } catch (ProtocolError exc) {
                    transport.RestartWrite();
                    sendProtocolError(exc);
                } catch (GenericException exc) {
                    transport.RestartWrite();
                    sendGenericException(exc);
                } catch (Exception) {
                    transport.CancelWrite();
                    throw;
                } finally {
                    transport.EndRead();
                }
                transport.EndWrite();
            }
Exemplo n.º 2
0
 public void CancelCall()
 {
     transport.CancelWrite();
 }