473,799 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to switch from a Ethernet Adapter to another-LAN to WLAN?

39 New Member
I am trying to familiarize myself with a C++ application which has a bug.

I'd like to have the application connect to WLAN when LAN is not available and vice versa.

Basically, it fails to connect to WLAN when LAN cable is plugged out. Is there a auto mechanism like Network manager which takes care of this? Or do i have to look after this in the code myself? If latter, any tips on how to do it?

Any help is appreciated.

Thanks!
Oct 1 '07 #1
10 3107
Colloid Snake
144 New Member
Is the application written so that it is supposed to? Are there distinct connections on the box that are being labeled as LAN and WAN (ie, is the app functioning correctly, and can the app function correctly)? If yes to both, I would think the issue is in the program itself.
Oct 1 '07 #2
ycinar
39 New Member
Is the application written so that it is supposed to? Are there distinct connections on the box that are being labeled as LAN and WAN (ie, is the app functioning correctly, and can the app function correctly)? If yes to both, I would think the issue is in the program itself.
It is written so... but appearantly not functioning fine. I need to make it work.

There are indeed distinct LAN and WLAN connections.

I wonder where i can find some example code which looks after transferring the connection from LAN to WLAN.. Even learning how to establish a connection over LAN or WLAN should help as well.

Thanks for your help!
Oct 3 '07 #3
Colloid Snake
144 New Member
If it is designed to do that, I would recommend looking at the code - my guess would be that it is in there.
Oct 3 '07 #4
ycinar
39 New Member
If it is designed to do that, I would recommend looking at the code - my guess would be that it is in there.
Thanks for your reply, yes the its the code i need to investigate.

I had some progression though. The question now is somewhat different: Say I have got two different Ethernet cards, one for LAN and one for WLAN. How could I determine which of the available connections is actively in use for my application?

Thanks!
Oct 4 '07 #5
sicarie
4,677 Recognized Expert Moderator Specialist
Do a packet capture or windump on the interface while the program is running (and nothing else, just to keep you from getting confused).
Oct 4 '07 #6
ycinar
39 New Member
Do a packet capture or windump on the interface while the program is running (and nothing else, just to keep you from getting confused).
I think I need to make a clarification:

say you have got 2 ethernet cards, Wireless and Wire. Program reads these and makes a connection with one of them, say Wire. Then you plug out your cable and would like your application make a new connection with Wireless. then you plug back in your LAN cable and something happens to your Wireless then you would like to make new connection with your LAN again.

BUT

While you are connected using LAN then Wireless is disabled, the program should do nothing at this case - no need to take any action as you were not using Wireless anyway, simple is that.

So the question is during the execution of the code, how can I determine which ethernet is being used? Is it the one in use or not?

Thanks again!
Oct 4 '07 #7
sicarie
4,677 Recognized Expert Moderator Specialist
You can see them in the command line by opening it up (run 'cmd' or opening a terminal window) and then executing the 'ipconfig /all' command on windows or the 'ifconfig' command on Linux. You will see your interfaces as your computer sees them. From here, it seems you need API help with whatever OS you are using to use that to find the interface handles.
Oct 4 '07 #8
ycinar
39 New Member
You can see them in the command line by opening it up (run 'cmd' or opening a terminal window) and then executing the 'ipconfig /all' command on windows or the 'ifconfig' command on Linux. You will see your interfaces as your computer sees them. From here, it seems you need API help with whatever OS you are using to use that to find the interface handles.

The program can read the ethernet info and make the relevant the connections if they are enabled/plugged etc.

I need to implement the fail over logic for the interfaces. Say if an interface is down for some reason (cable plugged out, disabled, etc), in that case I just want to detect if the the down interface is the one i was using for connection to the server.

Thanks guys!
Oct 4 '07 #9
ycinar
39 New Member
Can anyone suggest on how to figure out if the LAN cable is connected or not using C++? Like an listener?
Oct 5 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

24
3177
by: | last post by:
Hi, I need to read a big CSV file, where different fields should be converted to different types, such as int, double, datetime, SqlMoney, etc. I have an array, which describes the fields and their types. I would like to somehow store a reference to parsing operations in this array (such as Int32.Parse, Double.Parse, SqlMoney.Parse, etc), so I can invoke the appropriate one without writing a long switch.
1
3985
by: dalewz | last post by:
Hi, I am thinking to use C# in MS VS.net to support GUI and Ethernet communication. I heard that this is doable by opening a socket. Could sb share more info on this? Thanks. -Dale
8
11469
by: Edison Abarca Tapia | last post by:
Hi: I need change MAC(nic) Address. I help me pleaseeeee... thanks, Edison
2
5209
by: simon | last post by:
I use my functions to create adapter and fill dataSet: funkcije.createAdapter("c_CPOSkupaj", False, myParams).Fill(ds, "brezReklam") If I use this function another time to fill dataSet with other table, I get an error message, like that the parameter already exists. The SqlParameter with ParameterName '@datumZ' is already contained by another SqlParameterCollection
3
1934
by: Bob Greschke | last post by:
There is a lot to stuff that seems to skirt around this issue (most of which has to do with finding your IP address), but I can't find anything that explains how to write a client that (in my case) needs to collect some information from some equipment on a private network/Ethernet card, then transmit that info on the other Ethernet card/"outside" network to another program (which will put it into a db). "binding to a specific address is...
13
55401
by: KiwiGenie | last post by:
I am trying to connect to the internet using a USB Ethernet adapter. It installs but won't connect to my dsl modem. The ethernet light on the modem doesn't even light up, though the same cable works plugged from the modem to the ethernet port on hubby's laptop. I thought the adapter was all I needed to connect..what am I missing? Can someone please help point me in the right direction I really am stumped.
1
4896
by: kavok | last post by:
I am writing a software that needs to sniff packets in the network (raw ethernet) and also, with another thread send regular UDP packets with the common socket API's. However, when the RAW Ethernet sniffing is on, the socket API calls sending regular UDP packets don't work (although they report no error). Do any of you know why this happens? I'm using linux 2.4.20 (it has to be this version... don't ask me why). This is my code to...
0
1215
by: alexia.bee | last post by:
Hi All, Any know why NetworkInterfaceType returns Ethernet type for Wireless adapter and not Wireless80211? thanks.
2
2115
by: pugazhraj | last post by:
hai experts, iam new to network field and in our office ethernet switch board is not working .could any one know what are the possiblities for the problem and plz help me to solve the problem. regards, pugazh.
3
6522
by: jh3530 | last post by:
Hello, my apologies for the lame question, but I can't seem to figure this one out. I was recently given a laptop from my inlaws that is running windows 98. I wanted to get internet access on it, but it only had a telephone jack. I bought a USB ethernet adapter thinking this would solve the problem, but alas, it just sits there. It used to have a pcmcia card / adapter, but that got lost somehow. Can I use the USB ethernet adapter? I...
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.