public static MandelbrotJSON ReadFromString(string message) { try { return(JsonSerializer.Deserialize <MandelbrotJSON>(message)); } catch { TcpConnector.End(); TcpConnector.Serve(); return(null); } }
public static MandelbrotJSON ReadJSON(string filePath) { try { string jsonString = File.ReadAllText(filePath); MandelbrotJSON mandelbrotJSON = JsonSerializer.Deserialize <MandelbrotJSON>(jsonString); return(mandelbrotJSON); } catch { TcpConnector.End(); TcpConnector.Serve(); return(null); } }