how to make a broadcast ping in VC++.net??

elsayed_mazen
elsayed_mazen used Ask the Experts™
on
I am using winsock2.h for dealing with network programming. But I dont know how to make broadcast ping in it ??
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Hi!
What do you mean under "broadcast ping"?
Do you try find all "near" hosts?

Commented:
Hi!
What do you mean under "broadcast ping"?
Do you trying find all "near" hosts?

Author

Commented:
yes I mean that, I use the function setsockopt() and use the parameter SO_BROADCAST to make my socket dealing with the broadcasting, but there is a runtime error appeares when excute the program.
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Commented:
code please?
and what exactly error you get?
May be you use wrong type for SO_... value?
for SO_BROADCAST you have to use BOOL (reallly DWORD) value.

Author

Commented:
OK, forget that quistion, How can I know the hosts connected to the LAN by my program??
Commented:
Hi,
Try

Bool IsNetworkAlive(
  LPDWORD lpdwFlags     // Specifies the type of network connection
);

Good Luck!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial