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?
Quote from: Deception on December 14, 2004, 08:36 PM
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?
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.
You don't need an anti-idle type of message (ex: chat message) to stay connected for long periods of time.
Are you sending SID_NULL at regular intervals and responding to all SID_PING messages?
Quote from: UserLoser on December 14, 2004, 09:32 PM
You don't need an anti-idle type of message (ex: chat message) to stay connected for long periods of time.
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...
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
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 from: Arta[vL] on December 14, 2004, 09:44 PM
Are you sending SID_NULL at regular intervals and responding to all SID_PING messages?
I am sending SID_NULL every 120 seconds and responding to all SID_PING packets.
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 from: LoRd[nK] on December 15, 2004, 12:44 AM
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?
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.
Quote from: Zakath on December 15, 2004, 01:58 AM
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 from: Deception on December 15, 2004, 01:59 AM
Quote from: LoRd[nK] on December 15, 2004, 12:44 AM
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?
Why shouldn't I respond to SID_NULL? Wouldn't Battle.net think I disconnected if I didn't respond?
No. It's used as a backup to make sure the connection didn't drop; official Blizzard clients disguard it when received.
QuoteQuote 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?
No, Blizzard clients send it every 30 seconds.
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.
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).
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).
IIRC, the official clients send SID_NULL after 180000ms have passed since the last complete message was received.