Results 1 to 6 of 6

Thread: How do I send or receive UDP multicast with winsock OCX in VB6?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,181

    How do I send or receive UDP multicast with winsock OCX in VB6?

    I found that sending unicast is easy. Just set the protocol for UDP, bind the port you want to use listen for data on, set the port you want to send data to, and send the data.

    Even broadcast is easy you just set the port you are sending to, to the highest port in your network. If your network is all computers from 192.168.0.2 to 192.168.0.254 (with 192.168.0.1 being the router and 192.168.0.0 representing the network itself) then you simply set the IP address you are sending to to 192.168.0.255. The 255 number is the magic number for broadcast, meaning ALL computers on the network will be able to receive the transmission.

    The one thing I can NOT do is send to send a UDP packet addressed to multiple specific computers (IP addresses) without sending them to ALL computers on the network. This is called Multicast. I can simulate multicast by having my program have a list of IP addresses, and then a for-next loop that causes my program to send to each address in the list. But that's just a series of unicast transmissions. True multicast is actually where the outgoing packet has multiple destination IP addresses embedded in it, so that the router knows to send a copy of the packet to each destination computer. Multicast is supposed to be a feature built into the UDP protocol itself, not requiring the sending program to use a for-next loop. The sending computer should only have to send ONE packet (not multiple packets), and the router should take care of the rest.

    If you know how to configure the winsock OCX control in VB6 to perform true UDP Multicast, please let me know. Thanks in advance.

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: How do I send or receive UDP multicast with winsock OCX in VB6?

    I'm pretty sure there is no multicast UDP support in the Winsock control.

  3. #3
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    486

    Re: How do I send or receive UDP multicast with winsock OCX in VB6?

    Hello,

    sorry to bring this thread back to life but it describes what i want to do most accurately.

    I am trying to send multicast packets using winsock.

    There are some vague post found via google that state simply send to ip 214.0.0.1 but for the protocol I am using I need 239.255.0.1

    I do not need to receive multicast packets just send them, anybody have new insight?

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: How do I send or receive UDP multicast with winsock OCX in VB6?

    Don't confuse multicast with broadcast.

  5. #5
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    486

    Re: How do I send or receive UDP multicast with winsock OCX in VB6?

    yes I have done broadcast for another protocol as far as i understand I have to use multicast for this protocol sACN (streaming ACN)

  6. #6
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,473

    Re: How do I send or receive UDP multicast with winsock OCX in VB6?

    Quote Originally Posted by axisdj View Post
    Hello,

    sorry to bring this thread back to life but it describes what i want to do most accurately.

    I am trying to send multicast packets using winsock.

    There are some vague post found via google that state simply send to ip 214.0.0.1 but for the protocol I am using I need 239.255.0.1

    I do not need to receive multicast packets just send them, anybody have new insight?
    Multicast on IPv4 is required to use a specific range of addresses https://en.wikipedia.org/wiki/Multicast_address, this is not the same as the "normal" ip address associated with a NIC.

    https://stackoverflow.com/questions/...g-with-windows might be worth read though as it seems to contain some good information on the topic.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width