public static ClientDestination CreateDestination(I2PDestinationInfo destinfo, bool publish, out bool alreadyrunning) { lock ( RunningDestinations ) { if (RunningDestinations.TryGetValue(destinfo.Destination, out var runninginst)) { alreadyrunning = true; return(runninginst); } var newclient = new ClientDestination(destinfo, publish); ClientMgr.AttachClient(newclient); alreadyrunning = false; return(newclient); } }
public static ClientDestination CreateDestination(I2PDestination dest, I2PPrivateKey privkey, bool publish, out bool alreadyrunning) { lock ( RunningDestinations ) { if (RunningDestinations.TryGetValue(dest, out var runninginst)) { alreadyrunning = true; return(runninginst); } var newclient = new ClientDestination(dest, privkey, publish); RunningDestinations[dest] = newclient; ClientMgr.AttachClient(newclient); alreadyrunning = false; return(newclient); } }
internal static void ShutdownClient(ClientDestination dest) { ClientMgr.DetachClient(dest); RunningDestinations.TryRemove(dest.Destination, out _); }