public static bool CallFunctionWithTimeout(byte[]message,FunctionReturnCallback callback, Sirikata.Runtime.Time t) { if (message==null||callback==null||message.Length==0) return false; return iCallFunctionWithTimeout(message,callback,t.toClass()); }
public static void SetupTickFunction(TimeoutCallback tc, Sirikata.Runtime.Time t) { long us=t.microseconds(); TimeoutCallback wrapped_tc=null; long estLocalTime=GetLocalTime().microseconds()+us*2; wrapped_tc=new TimeoutCallback(delegate(){ try { tc(); }finally { long delta=estLocalTime-GetLocalTime().microseconds(); estLocalTime+=us; if (delta>0) { iAsyncWait(wrapped_tc,new TimeClass((ulong)delta)); }else { iAsyncWait(wrapped_tc,new TimeClass()); } } }); iAsyncWait(wrapped_tc,t.toClass()); }
public static bool AsyncWait(TimeoutCallback callback, Sirikata.Runtime.Time t) { if (callback==null) return false; iAsyncWait(callback,t.toClass()); return true; }