示例#1
0
        public TcpConn(Socket s, NetworkMgr mgr)
        {
            this.agentID = AgentID.Gen();

            tcpSocket  = s;
            networkMgr = mgr;

            writeEventArg.Completed += new EventHandler <SocketAsyncEventArgs>(DoEventComplete);
            readEventArg.Completed  += new EventHandler <SocketAsyncEventArgs>(DoEventComplete);
        }
示例#2
0
 public TcpServer(NetworkMgr networkMgr, params Option[] opts)
 {
     this.networkMgr = networkMgr;
     sAgentID        = AgentID.Gen();
     try {
         foreach (var x in opts)
         {
             x.Do(this);
         }
     } catch (Exception ex) {
         sLog.Debug("tcp_server", "init tcp server error {1}", ex.Message);
     }
 }
示例#3
0
        public int CompareTo(object obj)
        {
            AgentID rhs = (AgentID)obj;

            return(s.CompareTo(rhs.s));
        }
示例#4
0
 public ExecutorWorker(string name)
 {
     this.mName   = name;
     this.agentID = AgentID.Gen();
 }