Re: Multihoming problem
Re: Multihoming problem
- Subject: Re: Multihoming problem
- From: "Hamish Allan" <email@hidden>
- Date: Wed, 27 Feb 2008 13:47:37 +0000
On Wed, Feb 27, 2008 at 8:41 AM, peiyuan <email@hidden> wrote:
> 1. In binding, I use
> sin.sin_addr.s_addr = inet_addr("192.168.1.56");
> However, this is not working. It didn't receive any data. I have to
> change to sin.sin_addr.s_addr = INADDR_ANY;
> What I want to achieve is that
> A. Since I have two cards, sometimes I only want to use the wireless
> card or LAN to receive and send packet.
> B. I want to send data on both card.
>
> So, how?? What's wrong with my code?
INADDR_ANY has different meanings for send and receive. For send, it
means "on the primary interface". So if you want to send on more than
one interface, you have to send it separately to each. For receive
(bind), it means "listen on all interfaces". For your purposes, you'll
need a separate socket for each interface.
> 2. When I send data, only the LAN side will broadcast. The wireless side
> didn't send any data. I know that because the "192.168.1.33" didn't receive
> any packet from 192.168.1.56
>
> DATA = > 192.168.0.234(LAN) =====Broadcast=====> ok
> = > 192.168.1.56(Wireless) ===============X Why???
> 192.168.1.33
Your primary interface is 192.168.0.234, and you are sending on that.
Again, if you have one socket per interface, you'll be able to
broadcast on the wireless side.
Hamish
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden