Esempio n. 1
0
 private static void TerminateSaveResume()
 {
     _torrentSession.clear_alert_dispatch();
     using (var entry = _torrentSession.save_state(0xfffffff))
     {
         var data = Core.Util.bencode(entry);
         File.WriteAllBytes(".session_state", data);
     }
     _torrentSession?.Dispose();
     _torrentSession = null;
 }
Esempio n. 2
0
 private void TerminateSaveResume()
 {
     _torrentSession.clear_alert_callback();
     using (var entry = _torrentSession.save_state(0xfffffff))
     {
         var data = Core.Util.bencode(entry);
         File.WriteAllBytes(".session_state", data);
     }
     Task.Run(() =>
     {
         _torrentSession?.Dispose();
         _torrentSession = null;
     });
 }