This was my first time using sockets and i'm not much familiar with that. Your post and the link you provided to wikichip (which i didnt know) are really comprehensive, so thanks for your explanation and for pointing out also a possible bug of my code!