10 Replies - 1525 Views - Last Post: 21 August 2012 - 02:53 PM Rate Topic: -----

#1 Aprone  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 07-May 12

Strange winsock behavior on all computers except my laptop

Posted 07 May 2012 - 10:20 AM

This problem has had me stumped for weeks and I would LOVE to have some help.

I have a game I made in VB6 and it is using Winsock to keep between 60 and 80 players playing at any given time. This game was first launched 7 months ago and has been added to on a weekly basis ever since. I mention this because everyone's first reaction to a winsock problem is that the code must be incorrectly written. I also mention this to show why I can't simply post the game's code like I could do with a small project or sample program. Let me explain what is happening.

My laptop is a P6100 with dual core Pentium 200 Ghz processors, and running windows 7 64-bit. 4GB of RAM. I've been hosting this game's server on this laptop for pretty much the entire life of the project. Everything is working perfectly. I underline perfectly because it actually is, and that actually makes this whole mess more confusing to me since I'd expect the same code to work the same on another machine.

I've been wanting to free my personal laptop from the weight of running this server. I first moved this game server over to an old crappy computer running windows XP which was thrown together out of junk parts in my basement. Players immediately reported problems which seemed to be huge lag times between server messages being sent out. I, of course, assumed that this was due to the slowness of the ancient computer.

I next moved it over to a faster (but still slow) computer which was also running XP... same exact problem. The computer was still slow but it seemed capable of doing the calculations so I started to wonder if perhaps XP was the issue and not the processing speed.

I next decided that throwing a little money at the problem was the answer. I purchased a new tower that was even faster than my laptop. This system is a Dell 740 with dual Athlon 2.4Ghz processors and 2Gb of RAM. The new computer was running XP, but otherwise was equal or greater than my laptop. I moved the server program over and people instantly began receiving the exact same problem!

Well at this point I decided that XP was the issue so I installed Windows 7 32-bit on the system but with no help. I then put Windows 7 64-bit on it just so it would perfectly match my laptop. Still no help! I've disabled C-states on the machine just in case that was messing with my outgoing network traffic, made sure the firewall and anti-virus software and settings are identical between the 2 systems, and have even tested the laptop on the exact router port the new tower is using. In every situation the laptop runs the server perfectly and the tower fails miserably.

From what I can tell, the server program is working as intended. When I step through the code it triggers Winsock's data arrival as it should, it processes the data, and it then calls the senddata function and passes the return messages. The SendProcess and SendComplete don't show any activity but I also don't get any errors. After maybe 10, 50, or even over a hundred messages have been sent using Senddata, they will all suddenly flood through like hair stuck in a pipe. So the clients get nothing for several minutes and then are bombarded by a sudden rush of hundreds of messages. After the sudden rush, messages will go back to getting stuck somewhere between VB calling SendData and the actual messages being sent.

I have literally checked everything I could think of. I've had a few friends help me brainstorm anything that might be different between these computers. I'm starting to think I have a magic laptop! rofl! But in all seriousness, what could be causing all of these other computers to hang up and refuse to send data like this?

I'm using TCP so I've tried using NOSEND to disable Haggle's algorithm, even though these messages are far too large to be affected by that.

If someone is able to solve this problem, or help me solve this problem, they will become my new hero. Thanks in advance for any help this community may provide.

- Aprone

Is This A Good Question/Topic? 0
  • +

Replies To: Strange winsock behavior on all computers except my laptop

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 301
  • View blog
  • Posts: 1,783
  • Joined: 26-March 09

Re: Strange winsock behavior on all computers except my laptop

Posted 07 May 2012 - 10:58 AM

Difficult to comment directly, especially as we don't know exactly what you've tried (albeit it sounds like a lot).

A couple of things:

1. Ensure you have the latest network drivers installed for the chipset.
2. Try resetting the Winsock. From a DOS window type "Netsh winsock reset".

Check out this link for more details on item 2. It might be worth running the Show option to check the config between your laptop and the new machine.

Apologies if you've already tried these things.
Was This Post Helpful? 0
  • +
  • -

#3 Aprone  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 07-May 12

Re: Strange winsock behavior on all computers except my laptop

Posted 08 May 2012 - 04:27 PM

Maj3091, thank you for taking the time to reply.

I saw your suggestion only minutes after you posted it, but I decided to wait and only write back after I could test the results. Life keep getting in the way and I haven't been able to yet. I'm just checking in so that it doesn't look like I just posted a question and ran off forever.
Was This Post Helpful? 0
  • +
  • -

#4 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 301
  • View blog
  • Posts: 1,783
  • Joined: 26-March 09

Re: Strange winsock behavior on all computers except my laptop

Posted 08 May 2012 - 11:27 PM

No worries....you wouldn't have been the first if you had! :)
Was This Post Helpful? 0
  • +
  • -

#5 Aprone  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 07-May 12

Re: Strange winsock behavior on all computers except my laptop

Posted 10 May 2012 - 12:08 PM

LOL believe me I know all about the annoying people who post questions and never hang around for the answers. This is why I wanted to make sure I wasn't thrown into the lot with them. :)

Well this morning I was finally able to run some more tests.
The network adapters on the Laptop and the Dell both happen to be Broadcom Netlink, and each are running the latest drivers from the company website. I know it seems like a step in the opposite direction but I've even tried changing the Dell's drivers over to the latest version from Microsoft instead of the official Broadcom ones just to see if it might help any.

Resetting the winsock didn't help at all. Since the computer is a fresh install I didn't expect it to need resetting but I was happy to give it a try anyway. I have hit the point where I am no longer above trying even the oddest of ideas. To say this is still killing me would be an understatement.

Since I was already testing I took the opportunity to try the server software out on 2 other slow computers I had around the house. The first was another very old and slow tower running XP and it had the same problem, and the other was an older laptop also running XP SP2. I wanted to see if perhaps I had a second "Magic" laptop in the house, but it turns out I don't since it had the same issue.

I took your advice and dumped the winsock catalog for both the laptop and Dell but I don't know enough about this to even know what I'm looking for. In the event that anyone (who knows more about this) would care to take a look at the two logs I have posted them. Keep in mind that the laptop is the one that has been magically working for 7 months without even a single hiccup and the new Dell is having that odd issue where outgoing winsock messages group together for hundreds of messages and then let them all through as a giant mass.
www.kaldobsky.com/winsocklaptop.txt
www.kaldobsky.com/winsockdell.txt

I'm back to having no idea what to even try, so ANY help would be greatly appreciated.
Was This Post Helpful? 0
  • +
  • -

#6 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 301
  • View blog
  • Posts: 1,783
  • Joined: 26-March 09

Re: Strange winsock behavior on all computers except my laptop

Posted 10 May 2012 - 02:19 PM

Hmmmm....it's getting a little bit beyond my knowledge I'm afraid.

You could have a look at this link (if you haven't already) and also click on to the Advanced Issues link at the bottom. Maybe something in there will jump out at you and describe what you're seeing.

This post has been edited by maj3091: 10 May 2012 - 02:19 PM

Was This Post Helpful? 0
  • +
  • -

#7 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Strange winsock behavior on all computers except my laptop

Posted 10 May 2012 - 02:30 PM

I can't say I'm any less in the dark than you are, but you might try comparing those two files to see if any differences jump out at you. I found this site that lets you copy and paste the files and compare them online.
Was This Post Helpful? 0
  • +
  • -

#8 Neku  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 268
  • Joined: 21-May 09

Re: Strange winsock behavior on all computers except my laptop

Posted 10 May 2012 - 03:34 PM

well the only thing i could think of is either different IP address, but that may be unlikely.. or maybe some hardware difference..

does the new computer is a laptop too? or is it normal PC?
Was This Post Helpful? 0
  • +
  • -

#9 Aprone  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 07-May 12

Re: Strange winsock behavior on all computers except my laptop

Posted 13 May 2012 - 09:43 AM

Thanks for those links guys. The files were basically identical so I've been going through the mountains of information in maj's link, and the links branching from that, and the links branching from that... lol.

I'll report back here if I manage to solve the problem or if I'm still stuck.
Was This Post Helpful? 0
  • +
  • -

#10 Aprone  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 07-May 12

Re: Strange winsock behavior on all computers except my laptop

Posted 19 August 2012 - 06:44 AM

Well it's been 3 months and once again I'm back. Not long after I originally posted this topic I got myself distracted with another project and decided it was just easiest to leave the program running on the "magic" laptop.

I've suddenly had to come back to this issue after recent windows updates knocked the laptop out of commission! The only way to get it running again was to restore it back to factory defaults and then load everything back on it from backups. Even though this is the exact same laptop, hosting the exact same antivirus, and the same settings (as far as I can tell), it now suffers the same strange bottle necking issue with outgoing winsock data! So I'm currently without a magic computer and I have well over 2000 people looking to me to get things working again. :(

I've gone back and checked everything I could think of, including quite a few long-shots that probably didn't even make sense to try. My most recent attempt was to use TCP-Z to raise the number of half-open TCP connections windows would allow. No luck.

The problem is still exactly the same as it was in my earlier posts, but I'll toss in a little bit of new/recent observations that might help someone theorize what's going on. The client requests a connection to the server software and a welcome message is sent back to the client. From what I'm told, everyone receives this welcome message without any problems. Upon receiving that welcome message, the client sends back login info. This login info is always received by the server just as it should be. Immediately after receiving the login info the server sends the client assorted game information, but here is where things go wrong. The clients can sit forever and none of this ever comes in. The server shows that it called the winsock send command and received no errors of any kind, yet the sendprogress and sendcomplete events do not show up in the log. They do show up for the initial welcome message though.

From the server's perspective everything is being sent as it should, and even additional information such as players chatting between each other is sent out. The odd thing is that none of these will have any sendprogress or sendcomplete data.

Many clients simply give up after sitting there with an unresponsive program... following the welcome message. The only way anyone can get anything to happen is to enter a command that sends something new to the server. The moment they send the new command/message to the server (through the same winsock connection that is already open) the bottle neck unclogs and they are bombarded with everything that didn't arrive for them until now. Even stranger is the fact that the server log will now show the sendprogress and sendcomplete messages for everything that had been clogged! This is how I know the data is somehow being stuck on the server's side and not on the clients'.

Even if I load up the game on the same laptop that the server software is on, and I connect with 127.0.0.1, it still bottle necks the data!!! I've been just about tearing my hair out for the past 3 days since the laptop crashed. If any of this sparks a theory, please share it! I'm getting quite desperate.
Was This Post Helpful? 0
  • +
  • -

#11 Aprone  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 07-May 12

Re: Strange winsock behavior on all computers except my laptop

Posted 21 August 2012 - 02:53 PM

I wanted to stop back in and say that I have (thankfully) solved this problem! This ended up being the issue...
http://support.microsoft.com/kb/932349
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1