/// <summary> /// Starts the ZeroTier node/service /// </summary> /// <returns></returns> public int Start() { if (_hasBeenFreed == true) { throw new ObjectDisposedException("ZeroTier Node has previously been freed. Restart application to create new instance."); } _unmanagedCallback = OnZeroTierEvent; return(zts_start(_configFilePath, _unmanagedCallback, _servicePort)); }
public int InitSetEventHandler(ZeroTierManagedEventCallback managedCallback) { if (managedCallback == null) { throw new ArgumentNullException("managedCallback"); } int res = Constants.ERR_OK; if ((res = zts_init_set_event_handler(OnZeroTierEvent)) == Constants.ERR_OK) { _unmanagedCallback = OnZeroTierEvent; _managedCallback = new ZeroTierManagedEventCallback(managedCallback); } return(res); }
static extern int zts_start(string arg1, CSharpCallbackWithStruct arg2, ushort arg3);
static extern int zts_init_set_event_handler(CSharpCallbackWithStruct arg1);