I need some help.
I have created some collectingroutin for gathering userinfo that needs to connect to all users in the hub sequentialy. I have done an iterator in Client.CPP timer in the end of the file that iterates userlist. It first locks the user list with Client->LockUserlist then unlocks it when finished. And when only in one hub this works fine.
But when I am in more than one hub problem evolve. Alot of clients doesnt answer the CTMs but still answers to Get file list. What could this be? Anyhow Using the client in 3-4 hubs makes it VERY visible. And the problem is causing about 1/5 of the users to not answer. And they dont answer until I download fiellist or queue up som fakefiles (random Filenames added to my queue without beeing on the other users share)
I dont really get it? But it seems like there is a problem with invalidated userlist though I lock it. As there is no problem while only in one hub.
Also I wonder what does Lock l(cs); do exactly? I know its critical Section and is used for blocking other instances to write to the same data. But whats in it more?
ConnectToMe not answered while GET FILE LIST are. Lock l(cs)
Moderator: Moderators
ConnectToMe not answered while GET FILE LIST are. Lock l(cs)
You can always reach me nowhere!
I jus thave to update this question with more information.
I sniffed the outgoing/incomming connection when senind a CTM to a nonresponsive user. And it happens to be not as I thought. The user connects and the client->client handshake is taking place in exactly the way it is supposed to. Then I suddenly got an idea. I checked if the users (not thought to answer CTM) was in any of the other conncted hubs. And wow to my surprise they was. So I disconncted and did a manual CTM and the conncted and the IP/lock/key was stored in the user...
So hmms, in the other hub I already got theyre data but in the one they didnt seem to repsond, they responded but the data was never stored for the user in that hub. How come? (seems to be some user in many hubs problem) Some lock/same sata problem.
I sniffed the outgoing/incomming connection when senind a CTM to a nonresponsive user. And it happens to be not as I thought. The user connects and the client->client handshake is taking place in exactly the way it is supposed to. Then I suddenly got an idea. I checked if the users (not thought to answer CTM) was in any of the other conncted hubs. And wow to my surprise they was. So I disconncted and did a manual CTM and the conncted and the IP/lock/key was stored in the user...
So hmms, in the other hub I already got theyre data but in the one they didnt seem to repsond, they responded but the data was never stored for the user in that hub. How come? (seems to be some user in many hubs problem) Some lock/same sata problem.
You can always reach me nowhere!
Re: ConnectToMe not answered while GET FILE LIST are. Lock l
Lock is a class that locks the parameter (cs) when created. when the block that the object (l) is created in, its destructor is called. Then the cs is released.xayide wrote:Also I wonder what does Lock l(cs); do exactly? I know its critical Section and is used for blocking other instances to write to the same data. But whats in it more?
Consider:
a();
b();
c();
d();
if you want to lock the b and c function you can write:
a();
{
Lock l(cs);
b();
c();
}
d();
Opera
Creator of the dc++ fork, oDC found at:
http://gempond.com/odc
http://gempond.com/odc
Problem seems to be that the getUser() function returns only yhe first user in the list who has that nickname. So when a CTM is sent to a user that is in higher number hub (late connected) the user will connect but his data will be stored to the first user returned by getUser(). Gotta solve this any other way.
You can always reach me nowhere!