/// <summary> /// Send data (object) to connected clients /// </summary> /// <param name="server"></param> /// <param name="data">data to send to connected clients</param> /// <param name="compression">compress data using GZIP if set to true</param> public static void SendAll(this EasyTcpServer server, object data, bool compression = false) => server.SendAll(server?.Serialize(data), compression);
/// <summary> /// Send action (object) to connected clients /// </summary> /// <param name="server"></param> /// <param name="action">action code as string</param> /// <param name="data">data to send to connected clients</param> /// <param name="compression">compress data using GZIP if set to true</param> public static void SendAllAction(this EasyTcpServer server, string action, object data, bool compression = false) => server.SendAllAction(action.ToActionCode(), server?.Serialize(data), compression);