internal void MessageRPCClientConnection(IWebSocketConnection webSocket, string message, KeePassRPCService service) { KeePassRPCClientConnection connection = null; lock (_lockRPCClientManagers) { _lockRPCClientManagers.HeldBy = Thread.CurrentThread.ManagedThreadId; foreach (KeePassRPCClientManager manager in _RPCClientManagers.Values) { foreach (KeePassRPCClientConnection conn in manager.CurrentRPCClientConnections) { if (conn.WebSocketConnection == webSocket) { connection = conn; break; } } if (connection != null) { break; } } } if (connection != null) { connection.ReceiveMessage(message, service); } else { webSocket.Close(); } }