Skip to content

Publish utp protocol code as standalone library ? #569

@sgmihai

Description

@sgmihai

I am trying to write a torrent client, for learning purposes, and having a library for utp transmission would be nice.
There are no docs to that part of the code and I am not familiar with the specifics, so I have to ask, is this "vanilla" utp or does it have subtle differences in the eth ecosystem ? Can it be used to interop with torrent clients as is ?

Secondly, is there any chance this could be copied to a different repository and published to nimble ? Wouldn't have to be actively maintained, or code in nim-eth to link to it, just having it separately and dependecy free as possible would be nice.
I noticed it depends on a few units outside /utp that don't seem to have anything to do with utp itself, that might hinder this potential effort: eth_hash.nim keys.nim random2.nim - but it seems to be mostly for random number functions, and eth_hash for KeccakHash which I am not sure is used in utp protocol itself.

I think this would be a valuable addition to the nim ecosystem. Curious to know what you think.

edit: another issue might be compatibility with nim's asyncdispatch. I couldn't compile the example code in utp.nim with asyncdispatch:
type mismatch: got 'proc (server: UtpRouter[common.TransportAddress], client: UtpSocket[common.TransportAddress]): Future[system.void]{.gcsafe, locks: <unknown>.}' for 'proc (server: UtpRouter[TransportAddress]; client: UtpSocket[TransportAddress]): Future[ ... return fakeFuture' but expected 'AcceptConnectionCallback[common.TransportAddress]'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions