void channel_Idle(object sender, IdleEventArgs e) { bool bConnected = this.Response.IsClientConnected; if (bConnected == false) { LibraryChannel channel = (LibraryChannel)sender; channel.Abort(); } // e.bDoEvents = false; }
private static void Channel_Closed(object sender, EventArgs e) { ZServerChannel channel = (ZServerChannel)sender; channel.Closed -= Channel_Closed; // 避免重入 // 中断正在进行的检索 LibraryChannel library_channel = (LibraryChannel)channel.Tag; if (library_channel != null) { library_channel.Abort(); LibraryManager.Log?.Info(string.Format("ZServerChannel({0}) Channel_Closed() 引发 LibraryChannel.Abort()", channel.GetHashCode())); } List <string> names = GetResultSetNameList(channel, true); if (names.Count > 0) { FreeGlobalResultSets(channel, names); } }
void ReleaseAllChannelsBut(LibraryChannel channel) { for (int i = 0; i < this.Channels.Count; i++) { LibraryChannel cur_channel = this.Channels[i]; if (cur_channel == channel) continue; channel.Abort(); this.Channels.RemoveChannel(channel); i--; } }