public RpcAdapter createAdapter(string id) { RpcAdapter adapter = new RpcAdapter(id); addAdatper(adapter); return(adapter); }
public void addAdatper(RpcAdapter adapter) { if (_adapters.ContainsKey(adapter.id)){ return; } _adapters.Add(adapter.id, adapter); }
public void addAdatper(RpcAdapter adapter) { if (_adapters.ContainsKey(adapter.id)) { return; } _adapters.Add(adapter.id, adapter); }
public RpcAdapter createAdapterWithProxy(String id, RpcProxyBase proxy) { RpcAdapter adapter = null; adapter = new RpcAdapter(id); proxy.conn.adapter = adapter; // adapter.addConnection(proxy.conn); addAdatper(adapter); return adapter; }
public RpcAdapter createAdapterWithProxy(String id, RpcProxyBase proxy) { RpcAdapter adapter = null; adapter = new RpcAdapter(id); proxy.conn.adapter = adapter; // adapter.addConnection(proxy.conn); addAdatper(adapter); return(adapter); }
protected virtual void onMessage(RpcMessage m) { if (_adapter == null && _acceptor != null && _acceptor.adapter != null) // the connection from acceptor { _adapter = _acceptor.adapter; } if (_adapter != null && _adapter.dispatcher != null) //由adapter的线程执行 { _adapter.dispatcher.dispatchMsg(m); } else //由全局通信器进行调度执行 { RpcCommunicator.instance().dispatchMsg(m); } }
protected RpcConnection(RpcAdapter adapter = null) { this.adapter = adapter; RpcCommunicator.instance().registerConnection(this); }
public RpcAdapter createAdapter(string id) { RpcAdapter adapter = new RpcAdapter(id); addAdatper(adapter); return adapter; }
protected virtual void onMessage(RpcMessage m) { if ( _adapter == null &&_acceptor != null && _acceptor.adapter!=null) { // the connection from acceptor _adapter = _acceptor.adapter; } if (_adapter != null && _adapter.dispatcher!=null) { //由adapter的线程执行 _adapter.dispatcher.dispatchMsg(m); } else { //由全局通信器进行调度执行 RpcCommunicator.instance().dispatchMsg(m); } }