static void Main() { double d = 0.0; int i = 0; form = new MandelViewerForm(); Application.Run(form); try { // tell the mpi program to stop MandelViewerForm.sock_writer.Write(d); MandelViewerForm.sock_writer.Write(d); MandelViewerForm.sock_writer.Write(d); MandelViewerForm.sock_writer.Write(d); MandelViewerForm.sock_writer.Write(i); } catch (Exception) { // Do nothing. It just means that the socket connection to the pmandel program is broken. } }