/*
* Represents the connection to the debuggee
*/
- public abstract class Connection : IDisposable
+ public abstract class Connection
{
/*
* The protocol and the packet format is based on JDWP, the differences
if (!res)
break;
} catch (Exception ex) {
- Console.WriteLine (ex);
+ if (!closed) {
+ Console.WriteLine (ex);
+ }
break;
}
}
res.domain_id = r.ReadId ();
return res;
}
-
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- }
-
- ~Connection ()
+
+ public void ForceDisconnect ()
{
- Dispose (false);
+ TransportClose ();
}
}
{
socket.Close ();
}
-
- protected override void Dispose (bool disposing)
- {
- if (disposing) {
- //Socket.Dispose is explicit in < .NET 4.0
- ((IDisposable)socket).Dispose ();
- }
- base.Dispose (disposing);
- }
}
/* This is the interface exposed by the debugger towards the debugger agent */
conn.VM_Exit (exitCode);
}
- public void Dispose () {
+ public void Detach () {
conn.VM_Dispose ();
conn.Close ();
- conn.Dispose ();
notify_vm_event (EventType.VMDisconnect, SuspendPolicy.None, 0, 0, null);
}
+ public void ForceDisconnect ()
+ {
+ conn.ForceDisconnect ();
+ }
+
public IList<ThreadMirror> GetThreads () {
long[] ids = vm.conn.VM_GetThreads ();
ThreadMirror[] res = new ThreadMirror [ids.Length];