public void Hide(CloseReason reason) { Dispose(); OnClosingEvent(this, reason); Window.Current.Activated -= OnWindowActivated;//stop listening to app activation Canvas.SetLeft(flyoutPopup, Window.Current.Bounds.Width);//move it out of the screen }
void socketServer_SessionClosed(WebSocketSession session, CloseReason reason) { if (reason == CloseReason.ServerShutdown) return; SendToAll("System: " + session.Cookies["name"] + " disconnected"); }
void secureSocketServer_SessionClosed(WebSocketSession session, CloseReason reason) { lock (m_SecureSessionSyncRoot) { m_SecureSessions.Remove(session); } }
protected void RiseOnCloseRequired(CloseReason reason) { if (OnCloseRequired != null) { OnCloseRequired(this, new CloseEventArgs(reason)); } }
public async Task CloseAsync(PartitionContext context, CloseReason reason) { if (reason == CloseReason.Shutdown) { await context.CheckpointAsync(); } }
async Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason) { if (reason == CloseReason.Shutdown) { await context.CheckpointAsync(); } }
public async Task CloseAsync(PartitionContext context, CloseReason reason) { _log.InfoEvent("Close", new Facet("reason", reason), new Facet("partitionId", context.Lease.PartitionId), new Facet("offset", context.Lease.Offset)); }
static void appServer_SessionClosed(WebSocketSession session, CloseReason closeRs) { session.Close(); Console.WriteLine("客户端" + session.RemoteEndPoint.Port + "断开了连接!"); ClientNum -= 1; Console.WriteLine("客户端数目" + ClientNum.ToString()); }
/// <summary> /// Called when [close]. /// </summary> protected virtual void OnClose(CloseReason reason) { var closedHandler = Closed; if (closedHandler != null) { closedHandler(this, reason); } }
/// <summary> /// Closes the event processor partition. /// </summary> /// <param name="context">The context.</param> /// <param name="reason">The reason.</param> public Task CloseAsync(PartitionContext context, CloseReason reason) { Logger.Information("Stopping partition {Partition} processing. Reason: {Reason}", context.Lease.PartitionId, reason); _targetBlock.Complete(); _statLogger.Dispose(); return Task.FromResult(true); }
//------------------------------------------------------------------------------------------------------------------------ #endregion #region Functions //------------------------------------------------------------------------------------------------------------------------ async Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason) { DebugEx.TraceLog("Processor Shutting Down. Partition :" + context.Lease.PartitionId + ", Reason: " + reason); if (reason == CloseReason.Shutdown) { await context.CheckpointAsync(); } }
public async Task CloseAsync(PartitionContext context, CloseReason reason) { if (reason == CloseReason.Shutdown) { Clients.All.showMessageOnClient("XClose"); await context.CheckpointAsync(); } }
public Task CloseAsync(PartitionContext context, CloseReason reason) { if (reason == CloseReason.Shutdown) { return context.CheckpointAsync(); } return Task.FromResult(false); }
public async Task CloseAsync(PartitionContext context, CloseReason reason) { Console.WriteLine(string.Format("Processor Shuting Down. Partition '{0}', Reason: '{1}'.", context.Lease.PartitionId, reason.ToString())); if (reason == CloseReason.Shutdown) { await context.CheckpointAsync(); } }
public async Task CloseAsync(PartitionContext context, CloseReason reason) { Console.WriteLine("Shutting Down Event Processor"); if (reason == CloseReason.Shutdown) { await context.CheckpointAsync(); } }
async Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason) { Console.WriteLine("Processor Shutting Down. Partition '{0}', Reason: '{1}'.", context.Lease.PartitionId, reason); if (reason == CloseReason.Shutdown) { await context.CheckpointAsync(); } }
public async Task CloseAsync(PartitionContext context, CloseReason reason) { Trace.TraceInformation(string.Format("EventProcessor Shuting Down. Partition '{0}', Reason: '{1}'.", this.partitionContext.Lease.PartitionId, reason.ToString())); if (reason == CloseReason.Shutdown) { await context.CheckpointAsync(); } }
public async Task CloseAsync(PartitionContext context, CloseReason reason) { Console.WriteLine($"Processor Shutting Down. Partition '{context.Lease.PartitionId}', Reason: '{reason}'."); if (reason == CloseReason.Shutdown) { await context.CheckpointAsync(); } }
public PluginCloseInfo(CloseReason reason) : this() { if (reason == CloseReason.None) { throw new ArgumentException("None is not a valid CloseReason"); } FormReason = reason; }
public Task CloseAsync(PartitionContext context, CloseReason reason) { Trace.TraceInformation("Processor Shuting Down. Partition '{0}', Reason: '{1}'.", this.Context.Lease.PartitionId, reason.ToString()); this.IsClosed = true; this.OnProcessorClosed(); return context.CheckpointAsync(); }
public override void Close(CloseReason reason) { try { this.stream.Close(); this.socket.Close(); } catch { } CallOnClosed(reason); }
public async Task CloseAsync(PartitionContext context, CloseReason reason) { Trace.TraceWarning("SimpleEventProcessor CloseAsync. Partition '{0}', Reason: '{1}'.", this.partitionContext.Lease.PartitionId, reason.ToString()); _run = false; if (reason == CloseReason.Shutdown) { await context.CheckpointAsync(); } }
public async Task CloseAsync(PartitionContext context, CloseReason reason) { if (sqlConnection != null) sqlConnection.Close(); if (!WebJobsHelper.RunAsWebJobs) Console.WriteLine(string.Format("Processor Shuting Down. Partition '{0}', Reason: '{1}'.", partitionContext.Lease.PartitionId, reason.ToString())); if (reason == CloseReason.Shutdown) await context.CheckpointAsync(); }
public void socketServer_SessionClosed(WebSocketSession session, CloseReason reason) { lock (m_SessionSyncRoot) m_Sessions.Remove(session); if (reason == CloseReason.ServerShutdown) return; Console.WriteLine(session.ToString()+"connect disposed"); //SendToAll("System: " + session.Cookies["name"] + " disconnected"); }
public PluginCloseInfo(CloseReason reason) { if (reason == CloseReason.None) { throw new ArgumentException("None is not a valid CloseReason"); } FormReason = reason; ToolBoxReason = ToolBoxCloseReason.None; Cancel = false; }
void socketServer_SessionClosed(WebSocketSession session, CloseReason reason) { lock (m_SessionSyncRoot) m_Sessions.Remove(session); Kinesis.gKinesis.StopSkeletonTracker(); if (reason == CloseReason.ServerShutdown) return; }
public override void Close(CloseReason reason) { try { this.connected = false; this.tcpClient.Close(); } catch { } CallOnClosed(reason); }
async Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason) { _logger.EventProcessorStopped(reason.ToString(), context.EventHubPath, context.ConsumerGroupName, context.Lease.PartitionId, context.Lease.Offset, context.Lease.Epoch); if (reason == CloseReason.Shutdown) { await context.CheckpointAsync(); _logger.EventProcessorCheckpointed(context.EventHubPath, context.ConsumerGroupName, context.Lease.PartitionId, context.Lease.Offset, context.Lease.Epoch); } }
protected internal override void ConnectionLost(CloseReason reason) { if (_dataConnectorHandle != null) { _dataConnectorHandle.Close(); _dataConnectorHandle = null; } base.ConnectionLost(reason); }
public Task CloseAsync(PartitionContext context, CloseReason reason) { WriteLog("{0} > Close called for processor with PartitionId '{1}' and Owner: {2} with reason '{3}'.", DateTime.Now.ToString(), context.Lease.PartitionId, context.Lease.Owner ?? string.Empty, reason); if (_checkpointingOn) { return context.CheckpointAsync(); } else { return Task.FromResult<object>(null); } }
public CloseArgs(CloseReason reason) { this.reason = reason; }
public Task CloseAsync(PartitionContext context, CloseReason reason) { Console.WriteLine($"LoggingEventProcessor closing, partition: '{context.PartitionId}', reason: '{reason}'"); return(Task.CompletedTask); }
protected override void OnSessionClosed(CloseReason reason) { base.OnSessionClosed(reason); }
void NcsServer_UserClosed(T user, CloseReason reason) { NcsModule <T> .SessionClosed.Invoke(user, reason); }
public ClusterSessionEncoder CloseReason(CloseReason value) { _buffer.PutInt(_offset + 32, (int)value, ByteOrder.LittleEndian); return(this); }
protected override void OnSessionClosed(CloseReason reason) { // 会话关闭后的逻辑代码 base.OnSessionClosed(reason); }
Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason) { Console.WriteLine("Processor Shutting Down. Partition '{0}', Reason: '{1}'.", context.Lease.PartitionId, reason); return(Task.FromResult <object>(null)); }
public Task <bool> IsSafeToClose(string elementId, CloseReason closeReason) { return(Task.FromResult(closeReason == CloseReason.EscapeClosing || elementId != ElementId)); }
public Task Close(CloseReason closeReason) { ParentBarDropdown?.Hide(); return(Task.CompletedTask); }
void SessionClosed(ISocketSession session, CloseReason reason) { Interlocked.Decrement(ref m_TotalConnections); }
/// <summary> /// Closes the session by the specified reason. /// </summary> /// <param name="reason">The close reason.</param> public virtual void Close(CloseReason reason) { this.SocketSession.Close(reason); }
/// <summary> /// Called when [session closed]. /// </summary> /// <param name="reason">The reason.</param> internal protected virtual void OnSessionClosed(CloseReason reason) { }
/// <summary> /// Closes the specified channel. /// </summary> /// <param name="channel">The channel.</param> /// <param name="reason">The reason.</param> public abstract void Close(ICommunicationChannel channel, CloseReason reason);
public Task CloseAsync(PartitionContext context, CloseReason reason) => Task.CompletedTask;
public async Task CloseAsync(PartitionContext context, CloseReason reason) { }
Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason) { this.OnClose?.Invoke(this, new Tuple <PartitionContext, CloseReason>(context, reason)); return(Task.CompletedTask); }
public FormClosedEventArgs(CloseReason closeReason) { CloseReason = closeReason; }
public async Task CloseAsync(PartitionContext context, CloseReason reason) { logger.Info("Partition closed", () => new { processorId, context, reason }); await Task.FromResult(0); }
public virtual void OnSessionClose(SyncSession session, CloseReason reason) { }
public Task CloseAsync(PartitionContext context, CloseReason reason) { Console.WriteLine($"Processor Shutting Down. Partition '{context.PartitionId}', Reason: '{reason}'."); return(Task.CompletedTask); }
public Task CloseAsync(PartitionContext context, CloseReason reason) { Console.WriteLine($"Shutting down processor for partition { context.PartitionId }. " + $"Reason: { reason }"); return(Task.CompletedTask); }
/// <summary> /// Handles a <see cref="Connection"/> closure, with the given <see cref="CloseReason"/>. /// </summary> /// <param name="closeReason">The reason for the <see cref="Connection"/> closing.</param> protected abstract void CloseHandler(CloseReason closeReason);
public NetEventData(SocketType type, NetWorkState state, CloseReason reason) : this(type, state) { Reason = reason; }
async Task RemoveLeaseAsync(T lease, bool hasOwnership) { CloseReason reason = hasOwnership ? CloseReason.Shutdown : CloseReason.LeaseLost; if (lease != null && this.currentlyOwnedShards != null && this.currentlyOwnedShards.TryRemove(lease.PartitionId, out lease)) { this.settings.Logger.PartitionRemoved( this.accountName, this.taskHub, this.workerName, lease.PartitionId, lease.Token); try { if (hasOwnership) { this.keepRenewingDuringClose.TryAdd(lease.PartitionId, lease); } // Notify the host that we lost shard so shutdown can be triggered on the host await this.leaseObserverManager.NotifyShardReleasedAsync(lease, reason); } catch (Exception ex) { // Eat any exceptions during notification of observers this.settings.Logger.PartitionManagerError( this.accountName, this.taskHub, this.workerName, lease.PartitionId, $"Encountered exception while notifying observers of {this.leaseType} lease release: {ex}"); } finally { if (hasOwnership) { this.keepRenewingDuringClose.TryRemove(lease.PartitionId, out lease); } } if (hasOwnership) { try { await this.leaseManager.ReleaseAsync(lease); this.settings.Logger.LeaseRemoved( this.accountName, this.taskHub, this.workerName, lease.PartitionId, lease.Token); } catch (LeaseLostException) { // We have already shutdown the processor so we can ignore any LeaseLost at this point this.settings.Logger.LeaseRemovalFailed( this.accountName, this.taskHub, this.workerName, lease.PartitionId, lease.Token); } catch (Exception ex) { this.settings.Logger.PartitionManagerError( this.accountName, this.taskHub, this.workerName, lease.PartitionId, $"Encountered failure while releasing owned {this.leaseType}: {ex}"); } } } }
/// <summary> /// 有连接断开 /// </summary> /// <param name="session"></param> /// <param name="reason"></param> public static void OnSessionClosed(LunarSession session, CloseReason reason) { loger.Debug("连接断开: " + session.SessionID); BaseServerInfo.AllSessions.TryRemove(session.SessionID, out var tt); }
protected override void OnSessionClosed(CloseReason reason) { // 会话关闭后的逻辑代码 Console.WriteLine("close session!"); base.OnSessionClosed(reason); }
void MyServer_SessionClosed(MySession session, CloseReason value) { }
public Task <bool> IsSafeToClose(string elementId, CloseReason closeReason) { return(Task.FromResult(Multiple ? closeReason == CloseReason.EscapeClosing || elementId == ElementId || elementId == SelectorElementId || elementId == InputElementId : true)); }
private static void appServer_SessionClosed(WebSocketSession session, CloseReason reason) { System.Diagnostics.EventLog appLog = new System.Diagnostics.EventLog(); appLog.Source = "myService"; appLog.WriteEntry("session closed. reason:: " + reason); }
public ClosedEventArgs(System.Net.IPEndPoint iPEndPoint, CloseReason closeReason) { IPEndPoint = iPEndPoint; CloseReason = closeReason; }