Jump to content
  • Advertisement
Sign in to follow this  
xycsoscyx

Detecting Modem Connections

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can I detect if a user is connected to the net on a modem? I don't want to check transfer speed, as that can be misleading if they are using up their bandwidth with something else. Can I enumerate things in WinSock or somewhere else? I know WinSock has EnumProtocols (and WSAEnumProtocols), but those don't seem to tell me the physical means that it's connecting, just the protocol.

Share this post


Link to post
Share on other sites
Advertisement
You can use RasEnumConnections to see if there are any active RAS connections. What are you trying to do this for?

Share this post


Link to post
Share on other sites
Autoselection of the connection, I don't want to rely on the user selecting their connection, and I don't want to test the current download speed. Ultimately, I want to take action depending on the connection, automatically using the smaller data for modem users, but still accessing larger data for users with a faster connection.

Share this post


Link to post
Share on other sites
Probably a bad idea... this wouldn't allow you to cope with congested connections. Testing the download speed would be much more effective.

Share this post


Link to post
Share on other sites
But that won't produce acurate results all the time, will it? If I try to download a file in my app to test the speed, but the user is downloading something else and taking up all the bandwidth, then my download rate that I detect will be considerably off. The speed also depends on where I am downloading a file from, so if I'm downloading from a slow server, or the server just happens to be lagging, then my program might detect the connection as a modem speed, when it's really a lan or cable modem or whatever.

Share this post


Link to post
Share on other sites
Quote:
Original post by xycsoscyx
But that won't produce acurate results all the time, will it? If I try to download a file in my app to test the speed, but the user is downloading something else and taking up all the bandwidth, then my download rate that I detect will be considerably off. The speed also depends on where I am downloading a file from, so if I'm downloading from a slow server, or the server just happens to be lagging, then my program might detect the connection as a modem speed, when it's really a lan or cable modem or whatever.

If the connection is slow, then you WANT to treat it as slow. It doesn't matter whether the slowness is the result of congestion or low bandwidth.

Share this post


Link to post
Share on other sites
Forgetting about the reasoning, can I use the RasEnumConnections to determine the number of modem connections? I haven't used the Ras functions before (haven't even heard of them before actually), do they detect modem connections, or are there other connections that they might detect?

There is a more in depth reason why I am trying to detect modem users, but I might not need to ultimately. There are registry settings, but I don't know if they are reliable or not. Ultimately I just want to detect if a modem is being used or not, regardless of connection speed or whatnot. ATM I don't even care if they are getting less than 1kps on a T1. I was going to use some old school DirectConnect code, but I just noticed that it's no longer part of DX9 (not documented or supported any longer at least, I'm sure it's still there collecting dust in the source code though).

Thanks for the all the info, too.

Share this post


Link to post
Share on other sites
Quote:
Original post by xycsoscyx
Forgetting about the reasoning, can I use the RasEnumConnections to determine the number of modem connections? I haven't used the Ras functions before (haven't even heard of them before actually), do they detect modem connections, or are there other connections that they might detect?

They'll detect lots of different things; check out the docs for the szDeviceType field of RASENTRY to get a list.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!