草庐IT

startMonitoring

全部标签

c# - 我如何持续监控新的 TCP 客户端?

我有一个TCP服务器,它持续异步监视新传入的客户端并将它们添加到客户端列表中:publicclassTcpServer{publicListClientsList=newList();protectedTcpListenerServer=newTcpListener(IPAddress.Any,3000);private_isMonitoring=false;publicTcpServer(){Server.Start();Server.StartMonitoring();}publicvoidStartMonitoring(){_isMonitoring=true;Server.Be

ios - 当我在 block 中使用 self 时,我得到一个 nil。但是 self 没有释放

我使用继承BaseViewController的viewController。在BaseViewController的方法“viewDidLoad”中调用函数“monitorNetworkStatus()”。privatefuncmonitorNetworkStatus(){ReachabilityManager.shared.startMonitoring{[weakself](status,presentingVC)inprint(self?.description)}}ReachabilityManager是单例的。startMonitoring函数是这样的funcstartMo