flat assembler
Message board for the users of flat assembler.

Index > Windows > how to detect internet connection?

Author
Thread Post new topic Reply to topic
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 04 Jul 2010, 14:54
i need to detect if a connection is happen and if true, disconnect it. How can I do that?

_________________
Sorry if bad english.
Post 04 Jul 2010, 14:54
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 04 Jul 2010, 18:05
I'm not aware of any way to check for a connection. The only possible trick is to try to connect to existing and stable domain (e.g. www.google.com) using gethostbyname.
Post 04 Jul 2010, 18:05
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 04 Jul 2010, 18:29
InternetGetConnectedStateEx. But I'm not sure how to disconnect nor if this function is trustworthy. Perhaps RAS API + ManOfSteel's method is better than WinInet but I don't remember anything of RAS...
Post 04 Jul 2010, 18:29
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 05 Aug 2010, 04:07
Use the WinInet API. It has a function to check if internet connection is availabe or not as well as other functions to deal with "cyber" interactivities. O_o
Post 05 Aug 2010, 04:07
View user's profile Send private message Reply with quote
coconut



Joined: 02 Apr 2004
Posts: 326
Location: US
coconut 09 Aug 2010, 16:07
Post 09 Aug 2010, 16:07
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 16 Sep 2010, 09:46
Quote:

how to detect internet connection
with the amount of your phone bill. Razz

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 16 Sep 2010, 09:46
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.