Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. sending broadcast packets

sending broadcast packets

Scheduled Pinned Locked Moved C / C++ / MFC
sysadmintutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mridang Agarwalla
    wrote on last edited by
    #1

    hey. could anyone tell me how to send broadcast packets in C. For those of you who dont know what a broadcast packet is: "If you send a packet to 255.255.255.0 it goes to all the computers on the network" How can i also listen for broadcast packets. Basically, my requirement is that i have many computers on a LAN (roughtly around 30 - 50), the IP address of which are unknown. So i would like to find oit all the computes that are present on my network. I thinks this is a practical use for sending a broadcast packet.

    C 1 Reply Last reply
    0
    • M Mridang Agarwalla

      hey. could anyone tell me how to send broadcast packets in C. For those of you who dont know what a broadcast packet is: "If you send a packet to 255.255.255.0 it goes to all the computers on the network" How can i also listen for broadcast packets. Basically, my requirement is that i have many computers on a LAN (roughtly around 30 - 50), the IP address of which are unknown. So i would like to find oit all the computes that are present on my network. I thinks this is a practical use for sending a broadcast packet.

      C Offline
      C Offline
      CodeBeetle
      wrote on last edited by
      #2

      to listen for a udp broadcast packet, just create a udp socket on the client machine, binding it to a certain port. eg: 22222. Then broadcasting socket should broadcast on that port.


      CodeBeetle.Com


      M 1 Reply Last reply
      0
      • C CodeBeetle

        to listen for a udp broadcast packet, just create a udp socket on the client machine, binding it to a certain port. eg: 22222. Then broadcasting socket should broadcast on that port.


        CodeBeetle.Com


        M Offline
        M Offline
        Mridang Agarwalla
        wrote on last edited by
        #3

        okay. How can i create a UDP socket? ...and how can i send the UDP packet. Have you got any code to accomplish this?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups