Alo Sarv
lead developer

Donate via
MoneyBookers

Latest Builds

version 0.3
tar.gz tar.bz2
Boost 1.33.1 Headers
MLDonkey Downloads Import Module Development
Payment completed
Development in progress.
Developer's Diary
irc.hydranode.com/#hydranode

Tuesday, February 28, 2006

Reconstructing object hierarchies in CGComm

Did a nice 12-hour devsession, and made nice progress in several areas. Unfortunately I didn't get to global searching yet - guess that'll be next dev-session's topic. Anyway, here's the list of changes tonight:

Some 4-5 hours of the 12-hour session went to tracking the open connection issue on Windows. If you had used Hydranode on windows, you might have noticed hnshell freezing sometimes and other strange networking issues. After lengthy testing and research, I discovered that the moment connection count exceeded ~50 connections, UDP packets started failing in ed2k module. Further testing showed that networking everywhere in the app started behaving strangely when more than 50 connections were open. After more testing and surfing around, I finally discovered that by default, select() on Windows is limited to 64 sockets! This is one of the times where I really wish someone with Windows networking programming would hang around and tell me these things, heh. Anyway, the workaround is simple - define FD_SETSIZE to a value of your choosing (512 is max as far as I understand) before including sys/select.h and there you go.

So basically, what was happening until now with Hydranode on windows was that we only checked first 50 sockets always; since the ordering of the sockets is somewhat random, this caused HALF of the sockets to fail HALF of the time - enough to wonder why things are strange, but not enough to warrant deeper research. As the connection-count increased, the failure percentage increased as well, but those are rare cases when more than 100 sockets are open (well, until you start few torrents, anyway), so... UDP sockets displayed this issue more obviously, since UDP sockets are added to the select() socket descriptors listing after all other sockets have already been added, so the moment 64 TCP connections were reached, everything about UDP died.

Madcat, ZzZz

PS: New binaries are available for Windows and Linux; source code now available in three formats by default (zip, gz and bz2).




Comments:
Madcat, your work is amazing! Since i use hydranode from the beginning of the year it has become my very best experience in the P2P world. I can't help you with the programming but i am spreading this incredible piece of software among my friends and just count on me with any translation to Spanish.

Greetings from the Basque Country.

Jontxu
 
Hello,

I'm Spanish too and consider this piece of software as amazing! ;)

Are you in #hydranode channel?

Best regards from Spain.
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?