Re: How to know if a network adapter is connected




"fred_d" <duchassin@xxxxxxxxx> wrote in message news:gcnevp$neg$1@xxxxxxxxxxxxxxxxxxxxx
Bind is not working after recv().
Because after receiving network packets i would like to bind to usb network and if it's ok, i give USB address.

Excuse me if it's not very clear.

If i use bind before recv(), and i give an IP address to bind(), it's not working if the interface is not connected !

I'm turning and turning .... but i found no good solution (and simple ;-))))

Help!

Fred,

Binding a socket to an adapter instructs the NDIS to receive only from this socket. This is the only way I know to identify the network adapter, where a packet is received. You have to bind the adapter before calling any send/receive function. Sorry.

When you write a service (http://msdn.microsoft.com/en-us/library/aa446909.aspx) you get an IOCTL call (http://msdn.microsoft.com/en-us/library/ms891090.aspx), when the adapter state has changed. You can use this notification to update your sockets and bind to newly connected adapters.

/Helge

.



Relevant Pages

  • Re: How to know if a network adapter is connected
    ... This is the only way I know to identify the network adapter, ... Yes i agree but if the adapter is not connected to the network, the bind() function return SOCKET_ERROR. ... So i need to bind every socket each time i call the recv ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: BIND 9 on a dynamic ip address
    ... Andrew P. wrote: ... All I am looking to do is to use bind for hosts in my network ... configuring a DNS server ...
    (freebsd-questions)
  • Re: Local DNS Caching not caching on external interface
    ... I am very new to Bind and FreeBSD. ... I have just configured a Local DNS server using the built-in Bind ... query the caching name server from my local network. ...
    (freebsd-questions)
  • Re: recursive DNS servers DDoS as a growing DDoS problem
    ... (list of trusted peers who can request your zone files) ... allow-query {locals;}; ... This lets anyone on your network, and others you might trust, full ... Copy the bind config fully so you have two copies. ...
    (Bugtraq)
  • SELinux / bind conflict
    ... I'm having a bit of difficulty setting up bind on FC11 which I'm ... using in a standalone network environment (i.e. no external network ... flag in SELinux, any actions related to starting or stopping the named ... Message log entry: ...
    (comp.protocols.dns.bind)

Loading