How can Qnx6.1 find out a node is down?

I have several questions:
1,In QNX6.1,how can other nodes to realize a node is down in “real time”?
2,in sys/socket.h,the sockaddr struct is as the follow:
struct sockaddr {
uint_8 sa_len;
uint_8 sa_family;
char sa_data[14];
}
but in the BSD socket,the sockaddr is
struct sockaddr {
unsigned short sa_family;
char sa_data[14];
}
I tested them with the sockaddr_in struct and find they all can work,so,what
does QNX mean sa_len?
3,I have never tried to programme UDP broadcasting though I know it
could,so,can somebody tell me what is the broadcasting
address(IP255.255.255.255?) and the port so I can encode the sockaddr
requested by function of sendto()?




Thanks
ChaoLi

“ChaoLi” <xxs102@sohu.com> wrote in news:a8s897$n22$1@inn.qnx.com:

I have several questions:
1,In QNX6.1,how can other nodes to realize a node is down in “real
time”? 2,in sys/socket.h,the sockaddr struct is as the follow:
struct sockaddr {
uint_8 sa_len;
uint_8 sa_family;
char sa_data[14];
}
but in the BSD socket,the sockaddr is
struct sockaddr {
unsigned short sa_family;
char sa_data[14];
}

That’s strange, since on my FreeBSD box struct sockaddr looks like the
first structure, not the second. Which BSD box did you get that from?

I tested them with the sockaddr_in struct and find they all can
work,so,what does QNX mean sa_len?

sa_len is the total length AFAIK.

3,I have never tried to programme UDP broadcasting though I know it
could,so,can somebody tell me what is the broadcasting
address(IP255.255.255.255?) and the port so I can encode the sockaddr
requested by function of sendto()?

You need to set the broadcast option using setsockopt(), in order to have
permission to send a broadcast packet. Also, watch how much you send in
that broadcast - BSD kernels (and many others) do not accept fragmented
broadcast packets, so you need to insure that all you info will fit into an
MTU sized packet (this is to avoid a broadcast storm).



\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>