mirror of
https://github.com/fadden/6502bench.git
synced 2024-11-28 19:49:28 +00:00
Increase verbosity of sandbox ping
This commit is contained in:
parent
1b2679d712
commit
de6e61a37e
@ -39,6 +39,8 @@ namespace PluginCommon {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private byte[] mFileData;
|
private byte[] mFileData;
|
||||||
|
|
||||||
|
private DateTime mLastPing;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor, invoked from CreateInstanceAndUnwrap().
|
/// Constructor, invoked from CreateInstanceAndUnwrap().
|
||||||
@ -46,6 +48,8 @@ namespace PluginCommon {
|
|||||||
public PluginManager() {
|
public PluginManager() {
|
||||||
Debug.WriteLine("PluginManager ctor (id=" + AppDomain.CurrentDomain.Id + ")");
|
Debug.WriteLine("PluginManager ctor (id=" + AppDomain.CurrentDomain.Id + ")");
|
||||||
|
|
||||||
|
mLastPing = DateTime.Now;
|
||||||
|
|
||||||
// Seems to require [SecurityCritical]
|
// Seems to require [SecurityCritical]
|
||||||
//Type lsc = Type.GetType("System.Runtime.Remoting.Lifetime.LifetimeServices");
|
//Type lsc = Type.GetType("System.Runtime.Remoting.Lifetime.LifetimeServices");
|
||||||
//PropertyInfo prop = lsc.GetProperty("LeaseTime");
|
//PropertyInfo prop = lsc.GetProperty("LeaseTime");
|
||||||
@ -75,7 +79,9 @@ namespace PluginCommon {
|
|||||||
public int Ping(int val) {
|
public int Ping(int val) {
|
||||||
Debug.WriteLine("PluginManager Ping tid=" + Thread.CurrentThread.ManagedThreadId +
|
Debug.WriteLine("PluginManager Ping tid=" + Thread.CurrentThread.ManagedThreadId +
|
||||||
" (id=" + AppDomain.CurrentDomain.Id + "): " + val);
|
" (id=" + AppDomain.CurrentDomain.Id + "): " + val);
|
||||||
return val + 1;
|
int result = (int)(DateTime.Now - mLastPing).TotalSeconds;
|
||||||
|
mLastPing = DateTime.Now;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -84,9 +84,10 @@ namespace SourceGen.Sandbox {
|
|||||||
// waits for the currently-executing timer event to finish. So wrap
|
// waits for the currently-executing timer event to finish. So wrap
|
||||||
// everything in try/catch.
|
// everything in try/catch.
|
||||||
try {
|
try {
|
||||||
mPluginManager.Instance.Ping(0);
|
int result = mPluginManager.Instance.Ping(1000);
|
||||||
//Debug.WriteLine("KeepAlive tid=" +
|
Debug.WriteLine("KeepAlive tid=" +
|
||||||
// System.Threading.Thread.CurrentThread.ManagedThreadId);
|
System.Threading.Thread.CurrentThread.ManagedThreadId +
|
||||||
|
" result=" + result);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Debug.WriteLine("Keep-alive timer failed: " + ex.Message);
|
Debug.WriteLine("Keep-alive timer failed: " + ex.Message);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user