• Welcome to Valhalla Legends Archive.
 

A question about sockets...I think.

Started by Eternal, March 23, 2006, 01:44 PM

Previous topic - Next topic

Eternal

Hi all,

Would appreciate some advice. If my DSL connection drops (which it seems to do more often than it should, but that's another problem altogether) I notice that my bot just, well sits there. It disconnects, of course, but I am unable to make it autoreconnect unless I try to hit the enter button to send some data, for example. Then, it displays the socket error code and runs the autoreconnect routine I have written. Other bots, like Stealth for example, will display this almost immediately then reconnect.

I just wondered if anyone would offer some pointers on where I should be debugging to see why this is happening. I've tried putting in a few bits of code to run if the socket state (VB6....ewww) is not connected, but it never gets to that point.

Any help much appreciated.

Thanks,

^-----silly Brit
-----------------------------
www.brimd.com

Eric

#1
Send keep-alive packets and monitor times between SID_PINGs when idle.

Eternal

Thanks for the reply. I do already send keep alive packets. I'm wondering though how your suggestion will help. Would you mind elaborating?

thanks,
^-----silly Brit
-----------------------------
www.brimd.com

Yegg

Quote from: Eternal on March 23, 2006, 03:36 PM
Thanks for the reply. I do already send keep alive packets. I'm wondering though how your suggestion will help. Would you mind elaborating?

thanks,

http://bnetdocs.valhallalegends.com/content.php?Section=m&Code=192

I hope you're sending the packets properly. You just need to send 0x00 once, if Battle.net sends it back then you're still connected to them. However you should take Lord's advice and record how long it takes them to respond.

Zakath

I don't monitor response time at all - networks do suffer problems that will delay responses without shutting down the socket. However, when you disconnect and attempt to send an SID_NULL, you should be immediately getting back an error response indicating the socket is no longer open.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

Eternal

Thanks guys. I've monitored these suggestions and it seems I wasn't sending those packets correctly. Now that I am, once the DSL drops (or once someone removes the cable to test....) the socket error is being received properly and the bot is now reconnecting.

Thanks for your suggestions.
^-----silly Brit
-----------------------------
www.brimd.com

Eric

Quote from: Zakath on March 23, 2006, 05:20 PM
I don't monitor response time at all - networks do suffer problems that will delay responses without shutting down the socket.

This is true to an extent; however you should still close the socket if no data has been received in over x number of minutes.  IIRC, Battle.net will drop an inactive connection after about 3 minutes.

UserLoser

Quote from: Lord[nK] on March 23, 2006, 06:54 PM
Quote from: Zakath on March 23, 2006, 05:20 PM
I don't monitor response time at all - networks do suffer problems that will delay responses without shutting down the socket.

This is true to an extent; however you should still close the socket if no data has been received in over x number of minutes.  IIRC, Battle.net will drop an inactive connection after about 3 minutes.

I don't think they drop inactive connections unless something has changed very recently

Eric

Quote from: UserLoser on March 24, 2006, 12:06 AM
Quote from: Lord[nK] on March 23, 2006, 06:54 PM
Quote from: Zakath on March 23, 2006, 05:20 PM
I don't monitor response time at all - networks do suffer problems that will delay responses without shutting down the socket.

This is true to an extent; however you should still close the socket if no data has been received in over x number of minutes.  IIRC, Battle.net will drop an inactive connection after about 3 minutes.

I don't think they drop inactive connections unless something has changed very recently

I wasn't referring to the chat activity.

UserLoser

Quote from: Lord[nK] on March 24, 2006, 12:19 AM
Quote from: UserLoser on March 24, 2006, 12:06 AM
Quote from: Lord[nK] on March 23, 2006, 06:54 PM
Quote from: Zakath on March 23, 2006, 05:20 PM
I don't monitor response time at all - networks do suffer problems that will delay responses without shutting down the socket.

This is true to an extent; however you should still close the socket if no data has been received in over x number of minutes.  IIRC, Battle.net will drop an inactive connection after about 3 minutes.

I don't think they drop inactive connections unless something has changed very recently

I wasn't referring to the chat activity.

What are you referring to?  I know during the logon process you can freeze a connection for a long period of time.

Spilled

Seeming as I have shitty dsl similiar to yours (dropping all the time), I had this same problem and doing what Lord[nK] said by sending keep alive packets is how I fixed this instead of just sending them back when i recieved them =\

I miss cable :(

Eternal

Quote from: Spilled on March 24, 2006, 12:56 AM
Seeming as I have shitty dsl similiar to yours (dropping all the time), I had this same problem and doing what Lord[nK] said by sending keep alive packets is how I fixed this instead of just sending them back when i recieved them =\

I miss cable :(

My DSL line used to be very solid and stable. Then the modem died and I was sent a replacement by my ISP (same model, Speedtouch). Now I have the disconnect issue, so it makes me think that something with this modem is causing it, maybe. I'll probably replace it for something more robust and see.
^-----silly Brit
-----------------------------
www.brimd.com

Eric

Quote from: UserLoser on March 24, 2006, 12:23 AM
Quote from: Lord[nK] on March 24, 2006, 12:19 AM
Quote from: UserLoser on March 24, 2006, 12:06 AM
Quote from: Lord[nK] on March 23, 2006, 06:54 PM
Quote from: Zakath on March 23, 2006, 05:20 PM
I don't monitor response time at all - networks do suffer problems that will delay responses without shutting down the socket.

This is true to an extent; however you should still close the socket if no data has been received in over x number of minutes.  IIRC, Battle.net will drop an inactive connection after about 3 minutes.

I don't think they drop inactive connections unless something has changed very recently

I wasn't referring to the chat activity.

What are you referring to?  I know during the logon process you can freeze a connection for a long period of time.

Yes, providing that you reply to SID_PING and/or send SID_NULL every minute or two.

Networks

Quote from: Eternal on March 24, 2006, 01:28 AM
Quote from: Spilled on March 24, 2006, 12:56 AM
Seeming as I have shitty dsl similiar to yours (dropping all the time), I had this same problem and doing what Lord[nK] said by sending keep alive packets is how I fixed this instead of just sending them back when i recieved them =\

I miss cable :(

My DSL line used to be very solid and stable. Then the modem died and I was sent a replacement by my ISP (same model, Speedtouch). Now I have the disconnect issue, so it makes me think that something with this modem is causing it, maybe. I'll probably replace it for something more robust and see.

It's obviously not your modem since you stated prior that when a disconnect occurs Stealth Bot functions as it should. It's obvious therefore that it's the bot that you are coding is the problem.

Kp

Quote from: Networks on March 24, 2006, 04:22 PM
Quote from: Eternal on March 24, 2006, 01:28 AM
Quote from: Spilled on March 24, 2006, 12:56 AM
Seeming as I have shitty dsl similiar to yours (dropping all the time), I had this same problem and doing what Lord[nK] said by sending keep alive packets is how I fixed this instead of just sending them back when i recieved them =\

I miss cable :(

My DSL line used to be very solid and stable. Then the modem died and I was sent a replacement by my ISP (same model, Speedtouch). Now I have the disconnect issue, so it makes me think that something with this modem is causing it, maybe. I'll probably replace it for something more robust and see.

It's obviously not your modem since you stated prior that when a disconnect occurs Stealth Bot functions as it should. It's obvious therefore that it's the bot that you are coding is the problem.

It looks like he meant that he used to have a connection which would stay up for very long periods of time.  After his modem was replaced, the connection became prone to dying -- and severing any open TCP streams in the process.  His remarks are entirely irrelevant to the original problem, which was that the client was not detecting the stream had collapsed.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!