Application specific network interface in CEF3 based application - c++

I am writing a CEF3 based application. I have a requirement, where I can show available network interface and select any of them. Once I have selected the network interface all the traffic should route through that selected network interface. For example if I am having one Ethernet one wifi and one 3G network interface available in my system. and all communication is going through the default which is Ethernet. Now If I select wifi from the application, All communication within the application should go through wifi.
I searched a lot over net and figured out that using bind() function we can bind a specific IP address for communication. But, How can I achieve it in CEF3?
I am new to CEF3 and never written any networking software.
I have already gone through below links-
Using a specific network interface for a socket in windows
https://www.raymond.cc/blog/bind-windows-application-to-specific-network-adapter-with-forcebindip/
TCP/IP connection on a specific interface
I am writing cef3 application in win32/c++ so looking for the same.

Related

Programmatically detect network connectivity in Windows (C++)

I need to detect when the Windows system is connected to/disconnected from network (LAN or WLAN) in C++ and without using WMI.
I have found a way to do this for wireless networks. (I have answered my own question here after finding a way), but this does not work (obviously) when I connect/disconnect a LAN cable.
How can I detect a change in network connection when user has connected a LAN cable to his Windows system? Is there a general way (instead of having separate code for WLAN and LAN) to find this?
Note: The network may or may not be connected to the internet.

Multiple Simultaneous gRPC connections to different servers via different interfaces (eth0, wlan0, ppp0)

We have started using gRPC C++ for our embedded system project (ARM Processor Cortex-A7) as a client. We have successfully created a sample application which communicates with the server using protobuf.
We have a new requirement now. We have to open multiple connections to the different endpoints (or server) via different interfaces (like ethernet, wifi and cellular [using ppp]).
I tried to google but couldn't find any solutions to it. I have tried gRPC forum but hasn't received a proper reply to my question.
I have wondering if gRPC has provision to bind to a particular interface or IP. Linux POSIX socket provides SO_BINDTODEVICE option but I am not sure if gRPC has any application layer method or function to achieve it (can't find it in the documentation).
Or Can we achieve it via some other hack (may be by modifying the routing table?).

Detect devices on local network for client-server connection in C++

I'm trying to implement an auto-connect feature for my Android application DroidPad, which is basically a TCP server running on an Android phone which the PC application connects to.
To make the process easier for the user, is there any way in (portable?) C++ to scan the IP addresses on the local subnet, possibly ones with a certain open port? I've tried using UDP broadcasting, but couldn't get it to work. I'm currently using the wxWidgets toolkit for GUI and libraries.
Any ideas?
I found a solution: wxServDisc. It uses mDNS (aka Zeroconf / Bonjour) to discover devices on a subnet, and is also based on wxWidgets.

How do I communicate between C++ and Flash?

Is there any way I can have an integration between Flash AS and C++? Let's say I have created a socket using C++ and multi-casting it to several ip addresses.
On one of the IPs I am running a Flash client. Can I receive the Multicast message (sent by MFC/C++ application) through my Flash application.
Or at least can I develop a Flash plugin (menu item) using C++?
The main objective is I just need to get my hands on anything that shows the communication/interaction between C++ and Flash.
Depends on what you would like to do. If you host the swf's in your application you can use the ExtenalInterface in flash via the ActiveX container. http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html
We are using that method in our project, check it out (open source): http://www.casparcg.com/
If you want to talk to swf's outside your application Sockets would do the job I guess.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/Socket.html

How to acess COM port of remote system?

I Want to access the COM port present in the remote system from system. Any help would be appreciable.
I am using windows XP in both remote as well as local system.
The com0com project, and especially the com2tcp application should help you.
In conjunction with the Null-modem
emulator (com0com) the com2tcp enables
to use a COM port based applications
to communicate with the TCP/IP based
applications. It also allows
communication with a remote serial
port via the TCP/IP.
Personally, I use SerProxy, which makes that com port looks like telnet:
Serproxy is a multi-threaded proxy program for redirecting network socket connections to/from serial links, in cases where the remote end of the serial link doesn't have a TCP/IP stack (eg an embedded or microcontroller system). The proxy allows other hosts on the network to communicate with the system on the remote end of the serial link.
I also looked into com0com before, but I finally decide not to use it, as it requires a driver installation. Where as serproxy just need to be run. Another nice part is that if the com port is not being "used" remotely, I can still access it locally.
I've used Advanced Virtual COM Port to share a COM port remotely.
On the local PC, it creates a virtual COM port that mirrors the activity of a real COM port on the remote PC. The remote PC can be on a local network or on the Internet. (If on the Internet, you just have to make sure your firewalls allow the particular TCP ports through.)
I tried several programs to share a COM port remotely, but this was the only one I found that also shared the serial hardware handshaking signals. So we picked this one, and it worked great. We used it about 3 years ago, to access a Japanese CDMA modem dev board, sitting in Japan, from Australia.