internal RpcBatchServerContext(RpcServerContext ctx) { _innerCtx = ctx; _requests = ctx.GetArgs <RpcBatchRequest[]>(); _count = _requests.Length; _responses = new RpcBatchResponse[_count]; }
private static void DetectProc(RpcServerContext context) { throw new NotImplementedException(); //switch (context.MethodName) { //} }
// NextVersion //public static void Start(string[] dlls) //{ // foreach (IRpcServerChannel channel in _channels) { // channel.Start(); // _tracing.WarnFmt("RpcChannel<{0}> Started on {1}", channel.Protocol, channel.UrlPrefix); // } // if (_hasTransparent) // RpcGetArgsHelper.Build(dlls); //} private static void TransactionStartCallback(IRpcServerTransaction trans) { RpcServerContext context = null; try { context = new RpcServerContext(trans); RpcServiceBase serviceBase; PerfCounter.InvokePerSec.Increment(); PerfCounter.InvokeTotal.Increment(); if (_services.TryGetValue(context.ServiceName, out serviceBase)) { serviceBase.OnTransactionStart(context); } else { context.ReturnError(RpcErrorCode.ServiceNotFound, new Exception(context.ServiceName + " NotFound")); } } catch (RpcException ex) { context.ReturnError(ex.RpcCode, ex); } catch (Exception ex) { context.ReturnError(RpcErrorCode.ServerError, ex); } }
public override void OnTransactionStart(RpcServerContext ctx) { RpcServiceMethod method; if (!_methods.TryGetValue(ctx.MethodName, out method)) { ctx.ReturnError(RpcErrorCode.MethodNotFound, null); return; } else { method.Call(ctx); } }
public override void OnTransactionStart(RpcServerContext context) { //if (context.ContextUri) { RpcConnection conn = null; RpcClientTransaction tx = conn.CreateTransaction(context.Request); tx.SendRequest( delegate() { context.Return(tx.Response); }, -1 ); //} }
public override void OnTransactionStart(RpcServerContext context) { RpcServiceMethod method; if (!_methods.TryGetValue(context.MethodName, out method)) { throw new RpcException("TransactionStart", "", RpcErrorCode.MethodNotFound, null); } else { try { method.RatePerSecond.Increment(); method.TotalCount.Increment(); method.Concurrent.Increment(); method.Method.Invoke(_serviceObj, new object[] { context }); } catch (Exception ex) { context.ReturnError(RpcErrorCode.ServerError, ex); method.TotalFailed.Increment(); } finally { method.Concurrent.Decrement(); } } }
public abstract void OnTransactionStart(RpcServerContext context);
public override void OnTransactionStart(RpcServerContext context) { _serviceProc(context); }