>> uTP can be plugged in to any transport which supports
>> something that looks like recvfrom and sendto.
>
> How does the uTP event loop work? Have you tried or been able to make it
> work as a twisted ITransport?

There is a periodic call you may insert in to any event loop. Other
than that there is a function you call when you recv a packet, and you
pass it a function handle to call when it needs to send a packet. So,
in the implementation on Twisted, I use a normal Twisted UDP socket to
send an receive packets, and a task.LoopingCall to run the periodic
call. That's it.
I was able to get it running on Twisted very easily, using the direct
uTP API. I built an ITransport out of it, which wasn't too much
trouble, and even took a swing at the
Client/Server/Connection/Connector pile of objects to implement
reactor.connectUTP and reactor.listenUTP. Those have a lot of edge
cases around when the connection is lost or manually closed, which
I'll need to test, but it seems to work at a basic level.

-Greg
_______________________________________________
tahoe-dev mailing list
tahoe-dev@allmydata.org
http://allmydata.org/cgi-bin/mailman/listinfo/tahoe-dev

Reply via email to