Valhalla Legends Forums Archive | Battle.net Bot Development | Random disconnects?

AuthorMessageTime
Deception
No matter what product I am on, Battle.net closes the connection on my client after 8 to 12 hours of being idle. Is this normal?
Could it have anything to do with me sending a null every 2 minutes?
Has anyone else experienced this?
December 15, 2004, 2:36 AM
shadypalm88
[quote author=Deception link=topic=9910.msg92459#msg92459 date=1103078195]
No matter what product I am on, Battle.net closes the connection on my client [u]after 8 to 12 hours of being idle.[/u] Is this normal?
Could it have anything to do with me sending a null every 2 minutes?
Has anyone else experienced this?
[/quote]Emphasis mine. ;)  I haven't bothered with keeping bots online "24/7" in quite some time now, but I seem to remember that Battle.net will kick you off after a certain period of inactivity.

Hence the invention of the anti-idle.
December 15, 2004, 3:29 AM
UserLoser.
You don't need an anti-idle type of message (ex: chat message) to stay connected for long periods of time.
December 15, 2004, 3:32 AM
Arta
Are you sending SID_NULL at regular intervals and responding to all SID_PING messages?
December 15, 2004, 3:44 AM
shadypalm88
[quote author=UserLoser link=topic=9910.msg92472#msg92472 date=1103081546]
You don't need an anti-idle type of message (ex: chat message) to stay connected for long periods of time.
[/quote]Oh really?  I seemed to remember that even if I ponged the pings and send a NULL every once in a while, I still needed to talk every so often (i.e. hours) to stay online.

Or maybe I wasn't really sending the nulls...
December 15, 2004, 4:18 AM
UserLoser.
Pretty sure the server doesn't care about SID_NULL since I believe it's main purpose is to check if the connection is still alive.  IIRC, you can flood a hundred or so SID_NULL packets and the server doesn't ban you
December 15, 2004, 4:24 AM
LoRd
SID_PING (after failing to respond to ~5 pings, the connection will be dropped) acts as an anti-idle and SID_NULL (should not be responded to) is just a connection keep-alive.

If it was me, I'd start by packet logging my client overnight and if the logs looked normal, I'd assume it's my connection at fault.

When the bot attempts to reconnect after being disconnected, does it get CD-Key in use errors?
December 15, 2004, 6:44 AM
Deception
[quote author=Arta[vL] link=topic=9910.msg92473#msg92473 date=1103082292]
Are you sending SID_NULL at regular intervals and responding to all SID_PING messages?
[/quote]

I am sending SID_NULL every 120 seconds and responding to all SID_PING packets.
December 15, 2004, 7:57 AM
Zakath
I do the same thing (SID_NULL ever 120 seconds and respond to all SID_PINGs) and I can routinely stay online for days on end. I would say the problem is somewhere on your end. It could be that your connection is just dropping periodically for a few seconds. Even 24/7 internet connections aren't foolproof.
December 15, 2004, 7:58 AM
Deception
[quote author=LoRd[nK] link=topic=9910.msg92486#msg92486 date=1103093076]
SID_PING (after failing to respond to ~5 pings, the connection will be dropped) acts as an anti-idle and SID_NULL (should not be responded to) is just a connection keep-alive.

If it was me, I'd start by packet logging my client overnight and if the logs looked normal, I'd assume it's my connection at fault.

When the bot attempts to reconnect after being disconnected, does it get CD-Key in use errors?

[/quote]

Why shouldn't I respond to SID_NULL? Wouldn't Battle.net think I disconnected if I didn't respond?

As for when it reconnects, I don't get a CD-Key in use message.
December 15, 2004, 7:59 AM
Deception
[quote author=Zakath link=topic=9910.msg92489#msg92489 date=1103097521]
I do the same thing (SID_NULL ever 120 seconds and respond to all SID_PINGs) and I can routinely stay online for days on end. I would say the problem is somewhere on your end. It could be that your connection is just dropping periodically for a few seconds. Even 24/7 internet connections aren't foolproof.
[/quote]

I know it's not my connection because AIM is online with no disconnects when Battle.net disconnects me. I must be doing something wrong. I request the ad banner every minute. Would that cause it?
December 15, 2004, 8:01 AM
LoRd
[quote author=Deception link=topic=9910.msg92490#msg92490 date=1103097593]
[quote author=LoRd[nK] link=topic=9910.msg92486#msg92486 date=1103093076]
SID_PING (after failing to respond to ~5 pings, the connection will be dropped) acts as an anti-idle and SID_NULL (should not be responded to) is just a connection keep-alive.

If it was me, I'd start by packet logging my client overnight and if the logs looked normal, I'd assume it's my connection at fault.

When the bot attempts to reconnect after being disconnected, does it get CD-Key in use errors?

[/quote]

Why shouldn't I respond to SID_NULL? Wouldn't Battle.net think I disconnected if I didn't respond?
[/quote]

No.  It's used as a backup to make sure the connection didn't drop; official Blizzard clients disguard it when received.

[quote]Quote from: Zakath on Yesterday at 11:58:41 PM
I do the same thing (SID_NULL ever 120 seconds and respond to all SID_PINGs) and I can routinely stay online for days on end. I would say the problem is somewhere on your end. It could be that your connection is just dropping periodically for a few seconds. Even 24/7 internet connections aren't foolproof.

I know it's not my connection because AIM is online with no disconnects when Battle.net disconnects me. I must be doing something wrong. I request the ad banner every minute. Would that cause it?[/quote]

No, Blizzard clients send it every 30 seconds.
December 15, 2004, 8:35 AM
Kp
Actually, ad request is every 15 seconds.

Deception: what server(s) are doing this?  Over the past few days, West has dropped me several times on proven clients, but east + non-BNCS things stay up fine.  There may just be intermittent routing failures between you and the server, which you really can't combat.  Depending on where the failure is in the network, it might drop nobody, a few people, or the entire server population.
December 15, 2004, 4:39 PM
tA-Kane
Indeed, some servers are prone like that. I used to be able to stay on US East for a good week at a time (probably longer if I had more-forgiving siblings), without interruption. I recently experienced a preferences file corruption, which reset the server I used. Now, the connection usually drops after an indeterminate while (usually less than a day, though). I do remember mentioning it within the last week or two in Op [vL], even before this thread was started.

As for the purposes of NULLs and PINGs... It's a known thing that the TCP connection does not always automatically detect when the remote host has been dropped from the internet until you try to send data. Thus, NULLs simply make sure that the connection is still alive. The server sends NULLs every so often to make sure you're alive, and you should send NULLs (not NULL replies!!) every so often to make sure the server is still there. A perfect example case would be to disable all automatic-sending packets (nulls, ad requests, whatever else your bot thinks should be automatically sent)... then connect to Battle.net. Once you're logged in and sitting in a channel, pull your ethernet cord from your computer and count how much time it takes for your bot to realize it's been disconnected. It probably wont for quite a while. Then, try sending a chat message... it should realize the disconnect immediately, if you've been disconnected for a minute or two.

Pings, however, are used to measure the latency of the connection. The server sends you a ping packet, and you send the reply back as soon as possible. The server can then guesstimate the amount of time it takes for data to be sent from the server, received by you, sent from you, and received back at the server. In my opinion, it's rather useless for chatting things... but it's quite useful if you want to play non-laggy games; simply drop the players with high latency (high ping times).
December 15, 2004, 7:37 PM
iago
I generally use "uswest.battle.net" for a server, and I have never had a problem with disconnecting as a result of Battle.net (although I generally get disconnected every day or two due to my ISP, but that disconnects AIM, MSN, and everything else, too).
December 15, 2004, 10:23 PM
Skywing
IIRC, the official clients send SID_NULL after 180000ms have passed since the last complete message was received.
December 18, 2004, 6:47 AM

Search