Forum Navigation
tango.net.Socket
Moderators:
kris
Posted: 12/14/07 11:17:03 Modified: 03/09/08 13:37:44Hi there,
I think there's a problem with Nethost.getHostByName (and probably also, other synchronized methods) From what is written in: here if I understand correctly method with synchronized attribute is synchronized only on per-class-instance basis. I suggest changing getHostByName from current:
synchronized bool getHostByName(char[] name) { char[1024] tmp; hostent* he = gethostbyname(convert2C (name, tmp)); if(!he) return false; validHostent(he); populate(he); return true; }to:
bool getHostByName(char[] name) { char[1024] tmp; hostent* he; synchronized { he = gethostbyname(convert2C (name, tmp)); if(!he) return false; validHostent(he); populate(he); } return true; }The same reffers to getHostByAddr.
If it's required I think, I could provide simple test-case for this issue.