Git Product home page Git Product logo

Comments (7)

l-jonas avatar l-jonas commented on August 29, 2024 1

That sounds bad. The relay part (and the block exchange protocol part) are only for connecting to other devices and pulling files. Pushing files does not work. I started working on this topic at https://github.com/l-jonas/syncthing-lite/tree/file-uploading, but sending index updates to other devices is not implemented there.

from syncthing-lite.

l-jonas avatar l-jonas commented on August 29, 2024

Releasing it to somewhere else is not really planned. The unclean solution would be to copy the needed subprojects to your project. Using it somehwere else would not be a very good idea because it uses experimental Kotlin features (and Kotlin coroutines which are a problem if you use java).

The protocol bit was moved here because it makes it easier to implement new features in the client. This implies that breaking changes are not avoided (even for improvements).

The question is about which part of the protocol you're speaking. Some parts are expected to keep the way they are so releasing them would be possible.

from syncthing-lite.

thomaseizinger avatar thomaseizinger commented on August 29, 2024

I am planning to also write the app in Kotlin so that part shouldn't be a problem.
In a nutshell, the app should synchronize files between several phones. From what I understand, this means I will need the block exchange protocol and the relay part (since none of the devices can open a port by themselves).

from syncthing-lite.

imsodin avatar imsodin commented on August 29, 2024

This probably means that the "library part" is not yet complete, but there's nothing preventing sending indexes from happening, right? Also I believe publishing was a topic when merging the syncthing-java repo, just wasn't done because there wasn't any other consumer than the syncthing-lite app.

I had a quick look at the different packages/libraries (no idea of the java lingo for the `net.synthing.java.*" (core, bep, ...) parts) to try and figure out what's the purpose/separation between those, and was a bit confused. From my memory when did tiny contributions by updating the protocol stuff bep more or less just contained the protocol specifications and core did all the index exchange/syncing/..., i.e. all "operations". Now I found a lot of functionality in bep too. What's the "high level" separation between bep and core?

Edit: I maybe should I mentioned why I commented in the first place: I'd really like it if this project gets more momentum. It's generally cool to have another implementation of BEP and for android, it would in my opinion be huge if we got a native option with external SD support and more going. Having two apps, a lite one as existing and what you envision (which sounds like "the full thing") would be great. It's definitely a lot of work, but by sharing the work done on the protocol/syncing side of things, both projects can profit.

from syncthing-lite.

l-jonas avatar l-jonas commented on August 29, 2024

core is what's used by multiple components, bep is the connection handling, syncthing-client is a wrapper around it for "end users"

from syncthing-lite.

thomaseizinger avatar thomaseizinger commented on August 29, 2024

It would be my first syncthing contribution but I'd open to help out with the implementation as long as there is some guidance around how things should be done.

Is somebody willing to write up some issues around this topic?
Are there any cleanup tasks that need to be done first?

from syncthing-lite.

l-jonas avatar l-jonas commented on August 29, 2024

It's possible to subscribe to index updates at https://github.com/syncthing/syncthing-lite/blob/master/syncthing-bep/src/main/kotlin/net/syncthing/java/bep/index/IndexHandler.kt#L60.

At https://github.com/syncthing/syncthing-lite/blob/master/syncthing-bep/src/main/kotlin/net/syncthing/java/bep/connectionactor/Instance.kt#L140, it's required to send the index updates from the database first and then all new updates which can be queried from the IndexHandler (linked above). The ConnectionActor gets an IndexHandler which allows access to the database https://github.com/syncthing/syncthing-lite/blob/master/syncthing-bep/src/main/kotlin/net/syncthing/java/bep/index/IndexHandler.kt#L40.

One difficulty with that is that index updates should not prevent using the connection (some users have got huge indexes which must be received and sent after connecting the first time).

Lastly, there is the not working block pusher at https://github.com/syncthing/syncthing-lite/blob/master/syncthing-bep/src/main/kotlin/net/syncthing/java/bep/BlockPusher.kt. Index updates should not be sent directly. Instead, they should be added to the local database (from which they should be sent to all connections using the index update notification channels). The files to upload should be saved as file on disk and not as inputstream. (And it should be possible to know which of them should be uploaded for which file even after an App restart)

I'm not sure for listening at relay servers, but because both sides of a bep connection a relative symetric, I don't expect it to be to difficult. Eventually it helps to break up the connectionhandler code.

Edit: I suggest using https://github.com/l-jonas/syncthing-lite/tree/file-uploading as base because it adds saving the fields which are required to save all index fields.

from syncthing-lite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.