I've run into similar problems and also ended up having to re-implement a great part of the sockets module. A fix for these issues would be much welcomed. Regards