I've been trying to create a file using C/C++ which uses sockets to open network traffic for static IP, I've tried baking a simple socket opening and closing and sending some traffic on a socket, but it seems no traffic is passing through, as the entire process requires wifi to receive data using local host and send the received packet to the internet through the mobile network.
Any help will be highly appreciated :)
I am a beginner myself, so please take my answer with caution, as it might be wrong. But since noone answered, i will try to help you, but i am not sure if i even understood your question. Instead of using localhost, you maybe should try to get the active network adapter. Something like this maybe:
For port you can use a fixed port number if you have one, or 0 which should mean any. For the CheckConnection you could try to connect to the google servers, which should be always availible.