I'm programming with Winsock2. I have two network adapters in system, one for local connections (LAN), one for outer connections (PPPOE). When I perform a connect() call to connect to local address, it uses PPPOE adapter instead of LAN. I know I could tweak this using metrics, but can't I just use some hard-code to forcibly use LAN adapter? Thanks in advance!
相关问题
- Multiple sockets for clients to connect to
- Socket.io Extra Placeholder Frame being sent
- Sending the array of arbitrary length through a so
- In Perl, how can I check for the existence of Sock
- Extract IP from connection that listen and accept
相关文章
- Winsock redefinition errors [duplicate]
- boost:asio IPv4 address and UDP comms
- Twisted XmlStream: How to connect to events?
- maxevents parameter in epoll_wait() and the events
- Difference between Internal IP Address and Externa
- Get all IPs in the same network as my computer
- udp packet loss and recovery
- perform connect() on specific network adapter
Before you connect(), you need to bind() to the IP address of the LAN adapter. Just specify the IP address, and leave the port open (i.e. 0), so that the system can still chose one.