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(); }