OpenTCPStream question

Blitz3D Forums/Blitz3D Programming/OpenTCPStream question

Warren(Posted 2004) [#1]
I'm using OpenTCPStream to connect to my web server so I can run various PHP scripts. If the net connection is unplugged, it returns zero and we move on ... no problem there.

However, I'm wondering two things:

1) Is there a way to detect that the user is online or not? In other words, is there a way that I could tell them "You need to connect to the internet!" specifically, and not just a generic "Failed to connect" message?

2) If the user is using a dial-up modem, does "OpenTCPStream" open up the connection manager automatically or anything like that? Or does it just fail as it would with a direct connection?


electronin(Posted 2004) [#2]
I haven't tried this myself, but try InternetAttemptConnect from wininet.dll.
As for number 2, I have no idea.


Warren(Posted 2004) [#3]
Thanks, but I'd really rather keep this contained to within Blitz if at all possible. I want the use of external functions, even those embedded in Windows, to be a last resort...


bradford6(Posted 2004) [#4]
Epic,

try:

test_inet=OpenTCPStream( "www.google.com",80 )
Print test_inet


Warren(Posted 2004) [#5]
Yes, I can try, fail and react to that but I'm wondering what that does for modem users ... does it pop up the connection manager dialog? Does it fail outright if they aren't connected already?


Gabriel(Posted 2004) [#6]
I think it depends how their dialup networking settings are set. The user can set DUN to respond to a program trying to connect to the net by either :

1) Doing nothing.
2) Connecting.
3) ASking if you want to Connect.


I do have 56k, but I don't use DUN, so I can't test this any more.