public NetworkClient(NetworkConnection connection) { Connection = connection; State = ConnectionState.Closed; Behavior = ConnectionBehavior.None; CloseReason = ConnectionClosedReason.NeverOpened; }
public void SetBehavior(string behavior) { if (Enum.TryParse(behavior, true, out ConnectionBehavior b)) { connectionBehavior = b; Clients.Group(SuperviserGroupName).InvokeAsync(MethodServer, "Behavior", $"SignalR server behavior changed to: { b.ToString()}"); } }
private void EnterStateListening() { CloseReason = ConnectionClosedReason.None; State = ConnectionState.Listening; if (BehaviorSet(ConnectionBehavior.GenerateOutgoingHandshakes)) { Connection.Enqueue(HandshakePayload.Generate(State, false)); } Behavior = ConnectionBehavior.HandleIncomingHandshakesOnly; }
private void EnterStateClosed(ConnectionClosedReason reason) { CloseReason = reason; State = ConnectionState.Closed; if (BehaviorSet(ConnectionBehavior.GenerateOutgoingHandshakes)) { // If we have just come from a state where handshakes are required, then we should notify the endpoint that we are closing. Connection.Enqueue(HandshakePayload.Generate(State, false)); } Behavior = ConnectionBehavior.None; }
private void EnterStateOpen() { CloseReason = ConnectionClosedReason.None; State = ConnectionState.Open; Behavior = ConnectionBehavior.AllowOutgoingPayloads | ConnectionBehavior.HandleIncomingPayloads | ConnectionBehavior.GenerateOutgoingHandshakes | ConnectionBehavior.CloseOnTimeout; EnqueueSetupPayloads(); }
private void EnterStateOpening() { CloseReason = ConnectionClosedReason.None; State = ConnectionState.Opening; Behavior = ConnectionBehavior.GenerateOutgoingHandshakes | ConnectionBehavior.HandleIncomingPayloads | ConnectionBehavior.CloseOnTimeout; // Kick the connection off. EnqueueHandshake(true); KeepAliveMarker.Mark(); ClearIncomingSyncPools(); }
public ConnectionAdorner(Canvas designerCanvas, ConnectionBehavior connectionBehavior) : base(designerCanvas) { this._designerCanvas = designerCanvas; this._behavior = connectionBehavior; this._connector = _behavior.Connector; this._connection = _connector.Connection; this._connection.StrokeDashArray = new DoubleCollection(new double[] { 4, 2 }); this._drawingPen = new Pen(Brushes.LightSlateGray, 1); this._drawingPen.LineJoin = PenLineJoin.Round; this._drawingPen.DashStyle = DashStyles.Solid; Cursor = Cursors.Cross; }
public void SetConnectionBehavior(ConnectionBehavior behavior) { PerfConnection.Behavior = behavior; Console.WriteLine("Connection behavior set to: " + behavior.ToString()); Clients.Others.connectionBehaviorChanged(((int)behavior).ToString()); }
public void SetConnectionBehavior(ConnectionBehavior behavior) { TestConnection.Behavior = behavior; Clients.Others.connectionBehaviorChanged(((int)behavior).ToString()); }
[MethodImpl(256)] // Set for aggressive inlining. private bool BehaviorSet(ConnectionBehavior behavior) { return((Behavior & behavior) != 0); }