Weirdness with v3 netcode.
Displaying 1-5 of 5 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Swordsman

I haven't been around much since tVS went down, but I'm the leader of my highschool programming club now. My team is making a game with Verge, so I'm getting back into the scene again.

The netcode functions are simply awesome. I always wanted to do that with v2. ^_^ However, I discovered that in the VergeChat Netcode Example, the server doesn't realize when a client disconnects. I can have the client log in and out 16 times, and it counts it as a different user each time, so the server gets filled up with ghost clients. I'm not sure if this is due to SocketConnected() not working correctly, or if vec just messed up the vc... But somebody check this out, okay?

Please reply :)

Posted on 2004-12-11 20:14:01 (last edited on 2004-12-11 21:11:24)

vecna

Yeah, you're right. I've duplicated this but haven't been able to figure out whats causing it yet. I'll keep looking.

Posted on 2004-12-14 15:11:04

anonymous

I've been messing with the netcode as well, and have noticed the same issue.

Workaround:

In my code, I have the client send a 'heartbeat' every so often.

In the server loop, it receives the heartbeat from the client and then flags the client to keep it alive.

Every 5 seconds, the server runs through the client list to see who has sent a heartbeat.

If there is no heartbeat...
disconnect the dead client,
clear out its slot,
and move onto the next client for evaluation.

After a client has been evaluated, clear the heartbeat flag.

-FoxRom2k4

Posted on 2005-02-05 12:22:55

vecna

So I've been doing some network programming unrelated to verge (in C#) and .. basically.. i could never find a bug in the v3 netcode because there is no bug in the v3 netcode. Sockets only report disconnection under some magical ideal circumstances, circumstances which apparently frequently do not happen. So the keepalive/heartbeat/ping is basically the only reliable way to detect disconnection.

Maybe I can work something like that automatically into verge, but I haven't given it much thought yet.

Posted on 2005-12-12 22:50:54

Overkill

Yeah, heartbeat signals work well. Make sure you have them for both the client and the server. You don't want a client to keep trying to send signals to a no-longer existant server, and you want the server to weed out any unresponsive clients.

Basically, have a timestamp to remind a client or server to send a pulse signal every so often. If you don't receive a signal within a timeout period (has to be much large than pulse intervals to cope with latency) disconnect the socket. Reset the socket timeouts when ANY signal is received from the socket you're monitoring (since we don't want to disconnect a socket if it's already busy and clearly interacting with us, but heart-beats are good for when there's less traffic between the sockets).

Hopefully what I've said isn't too complicated, and I hope haven't left out any steps.

Posted on 2005-12-14 20:19:12


Displaying 1-5 of 5 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.