public void ForceSnapshot()
{
if (header == null) {
Read ();
if (header == null)
throw new Exception ("Log file could not be opened");
}
using (TcpClient client = new TcpClient ()) {
client.Connect ("127.0.0.1", header.Port);
using (StreamWriter sw = new StreamWriter (client.GetStream ())) {
sw.WriteLine ("heapshot");
sw.Flush ();
}
}
}