Implementing two-way traffic control in F#
This post describes how to implement two-way (TCP for instance) traffic control in F# by modifying slightly a Trolltech article available at http://doc.trolltech.com/qq/qq17-ratecontrol.html. Remote...
View ArticleRate meter in F#
The following code allows us to measure (and keep track of) the exchange rate (whether upload or download), and the time needed to exchange n additional bytes (assuming the rate is stable). open System...
View ArticleImplementing two-way traffic control in F# – bucket approach
We had previously given a way to implement two-way traffic control on a strict basis using a function which looped constantly to see if any data was available o read/write, and which processed it...
View ArticleBitTorrent in F# – Bencoded values
Bencoding values for the BitTorrent protocol is explained in a Wikipedia article on Bencoding or in the more general BitTorrent protocol page. Briefly, there are four types : byte strings : [string...
View ArticleBitTorrent in F#- Metainfo file handling
To exchange files, a BitTorrent client needs some information about the exchanged file(s). This information is contained within a file named the “metainfo” file. More details are explaind in the...
View ArticleBitTorrent in F# – I/O operations
Once the Metainfo file can be read, the client ought to know which files compose the transfer, and how to connect to sources for the transfer. In this post, we will define the elements we need to...
View ArticleBitTorrent in F# – Bitfield
The bitfield tracks which pieces of the transfer are already downloaded, and which aren’t. We therefore only need a structure which can track two states per value, which is why we use a bitarray...
View Article
More Pages to Explore .....