Bauglir.Ex.WebSocketServer.CloseAllConnection C# (CSharp) Method

CloseAllConnection() public method

close all server connections
public CloseAllConnection ( int aCloseCode, string aCloseReason ) : void
aCloseCode int WebSocketCloseCode constant reason
aCloseReason string textual data (max 123 bytes)
return void
        public void CloseAllConnection(int aCloseCode, string aCloseReason)
        {
            LockConnections();
            WebSocketServerConnection c;
            for (int i = fConnections.Count - 1; i >= 0; i--)
            {
                c = fConnections[i];
                if (!c.Closing && !c.Closed)
                    c.Close(aCloseCode, aCloseReason);
            }
            UnlockConnections();
        }