C/C++ detect network type

Posted by Gavimoss on Stack Overflow See other posts from Stack Overflow or by Gavimoss
Published on 2011-02-14T13:03:52Z Indexed on 2011/02/14 15:25 UTC
Read the original article Hit count: 169

Filed under:
|
|
|
|

I need to write a win32 c/c++ application which will be able to determine whether the PC it's running on is connected to one of 2 networks. The first network is the company LAN (which has no internet connection) and the second network is a standalone switch with a single PC connected to it (the PC that the program is running on).

I'm pretty new to network programming but so far I have tried testing to see if a network drive which is held on our LAN can be mapped. This works fine if the PC is connected to the LAN, the drive mapping succeeds so so LAN detection is successful. However, if the PC is connected to the switch, this results in a VERY long timeout which is not a suitable as it will delay the program so much as to make it unusable.

Does anyone have any alternative suggestions?

I'm using c/c++ in VS 6.0

© Stack Overflow or respective owner

Related posts about c++

Related posts about c