ConnectToMe not answered while GET FILE LIST are. Lock l(cs)

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
xayide
Posts: 21
Joined: 2003-06-12 09:38

ConnectToMe not answered while GET FILE LIST are. Lock l(cs)

Post by xayide » 2003-06-18 16:25

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?
You can always reach me nowhere!

xayide
Posts: 21
Joined: 2003-06-12 09:38

Post by xayide » 2003-06-18 18:13

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.
You can always reach me nowhere!

Opera
Programmer
Posts: 15
Joined: 2003-02-21 13:45

Re: ConnectToMe not answered while GET FILE LIST are. Lock l

Post by Opera » 2003-06-18 18:37

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?
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.

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

xayide
Posts: 21
Joined: 2003-06-12 09:38

Post by xayide » 2003-06-18 19:31

Thank u Opera....Now I know some more...Still the thing about uselist is un answered.
You can always reach me nowhere!

xayide
Posts: 21
Joined: 2003-06-12 09:38

Post by xayide » 2003-06-22 06:00

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!

xayide
Posts: 21
Joined: 2003-06-12 09:38

Post by xayide » 2003-06-23 15:35

Anyone have any suggestions. Problem is I dont know which user is connecting to me. So I cant store the IP/lock/key on the right user for nicks that exists more than once in the getUser() function.
You can always reach me nowhere!

Locked