Beispiel #1
0
 public void DelSession(uint conv)
 {
     if (dict.ContainsKey(conv))
     {
         UdpClientSession session = dict[conv];
         Log.InfoAf("[Udp] UdpClientSessionMgr Del Conv ={0} UdpSession RemoteIp ={1} RemotePort = {2}", session.GetConv(), session.GetRemoteIp(), session.GetRemotePort());
         dict.Remove(conv);
     }
 }
Beispiel #2
0
        private Dictionary <uint, UdpClientSession> dict = new Dictionary <uint, UdpClientSession>();  //conv -  UdpClientSession

        public UdpClientSession CreateSession(uint conv, IUdpMsgHandler _handler, Socket sendSocket, IPEndPoint remoteIEP, long heartBeatTime)
        {
            UdpClientSession session = new UdpClientSession(conv, sendSocket, remoteIEP, _handler, heartBeatTime);

            dict[session.GetConv()] = session;
            Log.InfoAf("[Udp] UdpClientSessionMgr  Conv={0} Add UdpClientSession RemoteIp ={1} RemotePort = {2}", conv, session.GetRemoteIp(), session.GetRemotePort());
            return(session);
        }