You might want to consider starting with source code for an existing servent and modifying it to suit your needs. Gnewtella is a wise choice.
There is a considerable amount of working involved in supporting just the basic protocol - this doesn't even include transfers. |