Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Winsock + vista problem

Author
Message
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 22nd Aug 2008 01:32 Edited at: 23rd Aug 2008 12:07
My networking code works fine on XP but on vista there seems to be a problem. I am fairly sure that the problem lies with the command 'inet_addr' which converts the IP from decimal to binary. The command seems to fail with INADDR_NONE even when the IP is acceptable.

The documentation suggests to me that vista should work fine with the command since vista is on the list of compatible operating systems but it mentions another method of converting the IP for vista only:
Quote: "On Windows Vista and later, the RtlIpv4StringToAddress function can be used to convert a string representation of an IPv4 address to a binary IPv4 address represented as an IN_ADDR structure. On Windows Vista and later, the RtlIpv6StringToAddress function can be used to convert a string representation of an IPv6 address to a binary IPv6 address represented as an IN6_ADDR structure. "


I wrote a little test that should determine whether or not it is this command that's the problem, I have attached it and it has the following code:



In summary:
1. Those of you who have vista, could you please download the test and run it; post the results.
2. How can I determine whether the user is using vista or not?
3. Has anyone had trouble with inet_addr in this context?

Attachments

Login to view attachments
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 22nd Aug 2008 01:43 Edited at: 22nd Aug 2008 01:55
Works fine here, one sec while I do a bit more experimenting.

[edit] I don't see anything wrong. Passing 127.0.0.1 gives a valid conversion, while passing a blank string correctly returns INADDR_NONE.



Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 22nd Aug 2008 02:00 Edited at: 22nd Aug 2008 02:11
Okay, in that case could you test the full version for me please? There are two tests in the attached zip, one that uses dark gdk and one that uses the console. Cube world involves moving around as a cube and file transfer receives a zip file with a few images in it.

The IP address to connect to for both of them is: 81.158.232.4


[edit] Actually, hold on - I think I know what the problem is...

Attachments

Login to view attachments
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 22nd Aug 2008 02:18
Both programs give me an error. Did you run my code?

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 22nd Aug 2008 02:24
Ah yes! There is indeed a difference!! On Vista, while passing a blank string INADDR_NONE is returned but on XP 0 is returned!

I changed the code to take this into account. Thanks a ton, I'm going to bed in about 15mins but if you can be bothered, could you test the new version for me please with the same IP (shutting the server off when I goto bed ). The new version is attached.

Attachments

Login to view attachments
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 22nd Aug 2008 02:26
They still both give the same error.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 22nd Aug 2008 02:31
Is this the error (the line number will be different):
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 22nd Aug 2008 02:32 Edited at: 22nd Aug 2008 02:38
Yes, although 1038 is the line number it reports.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 22nd Aug 2008 02:40
Oh for god sake, I really shouldn't be programming when I'm this tired... This one WILL work, the last one didn't work because of a really stupid mistake.. If you haven't given up hope yet, please try this last attempt (for tonight) with the same IP

Attachments

Login to view attachments
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 22nd Aug 2008 02:43
Same error. Go to bed.

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 22nd Aug 2008 02:44
Agreed
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 22nd Aug 2008 14:18 Edited at: 22nd Aug 2008 14:19
The problem was that I was checking to see if the local IP string was empty by doing LocalIP == "" which doesn't work in release mode for some reason ; I've just changed that to strlen(LocalIP) == 0. This new version should work (I live in hope).

If anyone with vista gets a chance, please give this new version (attached) a go connecting to the IP 81.158.232.4.

Attachments

Login to view attachments
Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 23rd Aug 2008 04:44 Edited at: 23rd Aug 2008 04:44
im on vista

both programs time out when trying to connect to the ip you supplied
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 23rd Aug 2008 12:05 Edited at: 23rd Aug 2008 12:14
That happens when theres no server at the IP/port you are trying to connect to. I had the servers turned off while I went to sleep because I can't sleep with the noise from the computer .

Use this thread to report test results since the thread name is more appropriate and in the OP of that thread is a note that says whether or not the server is online:
http://forum.thegamecreators.com/?m=forum_view&t=135673&b=2

This is confirmed working for one person with vista, managed to persuade a friend to test it last night.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 23rd Aug 2008 20:11
Quote: "That happens when theres no server at the IP/port you are trying to connect to. I had the servers turned off while I went to sleep because I can't sleep with the noise from the computer."


Seriously!! You sleep with your computer?

Strangely enough I have trouble getting to sleep in a dead quiet room. I usually have a ceiling fan going to provide a bit of white noise. My computer is in another room. Even with the noise I think the light would keep me awake.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 23rd Aug 2008 22:09
Here's my computer setup:


and then a little more to the left is my bed. I have trouble sleeping all of the time but any kind of noise or light makes it worse, I'm a very light sleeper unless I've taken sleeping pills or I'm very very tired
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 23rd Aug 2008 22:18
Noise doesn't bother me but light does. My neighbor has a mercury vapor lamp outside his garage that normally blazes through my translucent shades. I put box lids in the window to block the light and found I sleep better without the intense light blaring in. Instead of sleeping pills you might want to try melatonin. It's natural to the body and instead of making you sleep it allows you to sleep more deeply naturally. Melatonin is also light sensitive so it doesn't work unless your environment is relative dark.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Movian
16
Years of Service
User Offline
Joined: 5th Mar 2008
Location:
Posted: 24th Aug 2008 16:09 Edited at: 24th Aug 2008 16:10
i personally don't find environmental conditions affect my sleeping that much. So far my most impresive spot to fall asleep was on a small windowsill in a crowded Pub (you couldn't move, it was so packed), with a folk music band playing about 3-5 foot away from me.

Login to post a reply

Server time is: 2024-09-30 05:38:51
Your offset time is: 2024-09-30 05:38:51