Works on laptop, not on desktop

BlitzMax Forums/BlitzMax Programming/Works on laptop, not on desktop

Scienthsine(Posted 2011) [#1]
EDIT: I've been cutting the code down to try to get to the problem, still haven't but this is the code so far:



This is a lobby i'm working on for a rts. It's very very unfinished, and has many changes on the way.

My problem is that I've been developing on a laptop, and just switched to my desktop. Upon copying the files over and testing, I noticed that the lobby no longer works, it's almost like I'm loosing network traffic. I'm testing by running two instances of the program on the same computer. This example will automatically connect when the second instance is started. It assumes port 6969 is open for listening.

Anyway, I thought I had a linux vs windows problem since the laptop is only running windows. I booted windows on the desktop, still have the problem. I recompiled the executable on the laptop, and tried it there... all good... that same exe on the desktop fails. There isn't any multithreaded code, but it almost seems like maybe the problem is having multiple processors on the desktop?

I don't know, I'm getting very frustrated.

If anyone could give it a try and see what you find. Just compile/launch, then launch another instance, they should connect to each other. Send some messages back and forth several times. Sometimes it fails as early as in the 'report name' command, which is sent immediately after connecting, sometimes it fails after several successful messages.

Last edited 2011


Scienthsine(Posted 2011) [#2]
Update:
Ok, I've narrowed it down some. If I use a TCP dummy app to connect to my app above, everything works. That is, I always receive the data, and always send the correct data.

Furthermore, I've discovered that if I change the pollevent to waitevent, and make a timer to give us some 'update' events... everything works. Note however, that I'm using event queues in the actual app...

Anyway, still haven't figured it out completely... but it's odd that it works on my laptop, but not on either of the desktops, or either os on those desktops...

edit: Or just adding a delay 1 in the main loop makes it work. I'm not happy with this sort of fix though. I'm seeing actual lost tcp data without it. Considering my game (a rts) needs all data to be reliable, I can't have the possibility of lost data.

So I really need to figure out what's going on here.

Last edited 2011

Last edited 2011

Last edited 2011


Scienthsine(Posted 2011) [#3]
Come on, I need some help here...

I just can't understand why a delay 1 is the difference between working and not. I made a test to see if I could replicate this behavior with a simpler from scratch program... but it seems to work fine. So it's something to do with my program... but why a delay would make it work... and why it works perfectly without the delay on the laptop... I'm at a loss.

This is the current code that shows the problem:


This is the test I made today, which does _NOT_ have this problem...


Any help is _greatly_ appreciated.

Last edited 2011


xlsior(Posted 2011) [#4]
How do the specs compare between the laptop and the desktop?

You say that adding a delay 1 on the desktop works -- is the desktop faster?


Scienthsine(Posted 2011) [#5]
Thanls for the reply, i guess blitzmax has kinda bit the dust since i've been away? Forum seems pretty inactive.

The laptop is about half the speed. Which may be the problem, maybe i have a race condition in there somewhere in respect to the program execution vs the tcp data... but i have yet to spot it.

Did you try the code? I'd be interested in how it performs on other machines, with and withoutthe delay.