// 这个channelId是由CreateAcceptChannelId生成的 public static void OnAccept(this NetInnerComponent self, long channelId, IPEndPoint ipEndPoint) { Session session = self.AddChildWithId <Session, AService>(channelId, self.Service); session.RemoteAddress = ipEndPoint; //session.AddComponent<SessionIdleCheckerComponent, int, int, int>(NetThreadComponent.checkInteral, NetThreadComponent.recvMaxIdleTime, NetThreadComponent.sendMaxIdleTime); }
private static Session CreateInner(this NetInnerComponent self, long channelId, IPEndPoint ipEndPoint) { Session session = self.AddChildWithId <Session, AService>(channelId, self.Service); session.RemoteAddress = ipEndPoint; self.Service.GetOrCreate(channelId, ipEndPoint); //session.AddComponent<InnerPingComponent>(); //session.AddComponent<SessionIdleCheckerComponent, int, int, int>(NetThreadComponent.checkInteral, NetThreadComponent.recvMaxIdleTime, NetThreadComponent.sendMaxIdleTime); return(session); }