public int BeginCall(int funcid, Packers.AbstractPacker packer) { int seq = getSeq(); transport.BeginWrite(seq); Packers.Int8.pack(CMD_INVOKE, transport); Packers.Int32.pack(funcid, transport); replies[seq] = new ReplySlot(packer); return(seq); }
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(); }
public void BeginWrite(int seq) { transport.BeginWrite(seq); }