marc321

Members
  • Content Count

    28
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by marc321


  1. Hi,

     

    I'm trying to develop an application based on BitTorrent Sync, written in C++. My main difficulty at this time is to manage the btsync process, I was wondering if there's someone here who knows c++ and who could possibly help me with that.

     

    In fact I've already asked on StackOverflow:

    http://stackoverflow.com/questions/26624871/problems-developing-cross-platform-app-with-boost-process-0-5

     

    As this question is intrinsically linked to Btsync, I though it would be a good idea to look for help here as well. So, if you think you can help, or know someone who can, please do!

     

    Thanks everyone

    Marc


  2. Man, I'd like to let you know about an issue with the new version of BTSync (v1.4).

     

    Have a look at this snippet:

    var btSyncClient = new BTSyncClient(SYNC_SERVER, SYNC_PORT, SYNC_USERNAME, SYNC_PASSWORD, syncName);Console.WriteLine("New API instance created");//  applies transfer control, if defined by bool variableif (transferSpeedLimit){    var btSyncPrefs = new Arendee.BTSyncLib.Model.SyncPreferences();    btSyncPrefs.UploadLimit = uploadSpeedLimit;    await btSyncClient.SetPreferences(btSyncPrefs);}

    This will throw an exception: ->  Could not convert string to integer: *5. Path 'recv_buf_size', line 1, position 1389  <-

     

    I'll not look into this myself because I had to decide against using BTSync.


  3. I'm trying to write a wrapper around BTSync using the API so I can handle all the shares programatically.

     

    I'd like to see the config being passed as value to the app in an argument rather than only as a feel on HDD. This way I can keep my api key hidden away when I pass the parameters to the app at startup.

     

    That's a great suggestion, and should be easy to implement! Not only the api key, but also the webui address and authentication data, are regarded as sensitive in my opinion.

     

    Of course, this approach wouldn't prevent someone with really advanced knowledges from getting that info, but it should do fine for average PC users as the ones I'm targetting.

    _______________

     

    I'd also like to bring to light the following request from the community (turns out it's mine as well), hoping it gets more eyes onto:

     

    Run BTSync as a Windows service (http://forum.bittorrent.com/topic/29659-btsync-as-a-windows-service/)


  4. In my opinion, this demand could/should be taken with a much greater priority than it is at this time.

     

    I do not mean to be rude (and I'm aware I'm not paying a penny for using this great software), but judging by the fact the original post dates from over a year ago, and by the fact it would take me (a rather beginner software developer) to code this functionality in C++ and deploy it in under a week, I can't help but thinking this project lacks some better management.

     

    And that's my 2 cents, which I hope are taken as a constructive criticism.

     

    Edit: If it adds, I'm developing a software for a big company in my country using the API, and this company would be willing to license BTSync or even hire a team to develop something from scratch (at great expenses) if necessary.


  5. Thank you for elucidating, mate.

     

    Do you see any reason I should not do the following?

    public async Task Run()Run("localhost", 8888, "spongebob", "squarepants", "HelloBTSync").Wait;

    This eliminates the need of using Thread.Sleep() and seems to be a better approach.

     

    Also, shouldn't I instantiate BTSyncClient before the beginning of the try clause?


  6. Dear Delegatevoid,

     

    as I'm new to OOP programming, and since your (excellent) implementation relies heavily on it's concepts, I'd like to clarify an issue I'm having.

     

    I have developed an application which:

    1 - starts an instance of Btsync.exe with the supplied config file using Process.Start()

    2 - creates a folder C:\test

    3 - makes use of the AddFolder method to have that folder synced (a read-only key is provided with my application)

    4 - closes itself (btsync will remain running)

     

    The problem is, my program won't accomplish step 3 unless I give it some time before the program closes (either using Console.Read() or Thread.Sleep() ). I do believe this is caused by the method being asynchronous. Is it correct? What can I do about this, other than pausing the execution for a little while before the program exits?

     

    Anyone else please feel free to help me on this as well. Thanks!

     

    Answer

     

    I was using

    static async void AddFolderToSync()

    and calling that method under the Main method of my console app. Now I've switched to

    static async Task AddFolderToSync()

    and it's called like this

    AddFolderToSync().Wait()

    and my problem is solved. :D

     

    Reference: http://stackoverflow.com/questions/3840795/console-app-terminating-before-async-call-completion