Jump to content

merijnb

Members
  • Content Count

    28
  • Joined

  • Last visited

Everything posted by merijnb

  1. merijnb

    UDP multicast issues

    UDP singlecast and broadcast is working fine (I've done that many times), this is the first time I need to use multicast though and it behaves a little bit differently internally (the whole IP_ADD_MEMBERSHIP thing). I respect you (Angus) can't help me though, any other takers? Or do we know who wrote this part in ICS originally?
  2. merijnb

    UDP multicast issues

    Hi Remy, Thanks, but I realize that, but the multicast group ip being used is 225.255.255.255 (easy to overlook that 🙂 )
  3. merijnb

    UDP multicast issues

    Tx for the wonderful quick reply. I've looked at TIcsIpStrmLog but there is no use of multicast in there. With regard to MultiCastAddrStr being for sending only I'm quite sure it's not. I've found several places where it's mentioned that to use multicast listening it's required to call setsockopt() with IP_ADD_MEMBERSHIP to 'register' the multicast group you want to listen to with the kernel, the working piece of Python code also does something similar. Other places this is mentioned are for example: https://stackoverflow.com/questions/43322462/multicast-packet-seen-in-wireshark-but-not-received-by-user-program-windows-an and http://www.tldp.org/HOWTO/Multicast-HOWTO-6.html There is something in the ICS wiki about receiving multicast data: WS.Proto:='udp'; WS.Addr:='192.168.0.1'; // IP address of the physical adapter I want to bind to WS.Port:='5000'; WS.MultiCast:=true; WS.ReuseAddr:=true; WS.MultiCastAddrStr:='239.192.1.1'; // Mutlicast IP WS.Listen; (from http://wiki.overbyte.eu/wiki/index.php/TWSocket.MultiCast) I also see something like that in OverbyteIcsWsocket: if FMultiCast then begin if FAddrFormat = AF_INET then begin { Use setsockopt() to join a multicast group } { mreq.imr_multiaddr.s_addr := WSocket_inet_addr('225.0.0.37');} { mreq.imr_multiaddr.s_addr := sin.sin_addr.s_addr;} { mreq.imr_multiaddr.s_addr := WSocket_inet_addr(FAddrStr);} mreq.imr_multiaddr.s_addr := WSocket_Synchronized_inet_addr(PAnsiChar(AnsiString(FMultiCastAddrStr))); { mreq.imr_interface.s_addr := htonl(INADDR_ANY);} { RK} mreq.imr_interface.s_addr := WSocket_Synchronized_ResolveHost(AnsiString(FAddrStr)).s_addr; iStatus := WSocket_Synchronized_SetSockOpt(FHSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP, @mreq, SizeOf(mreq)); if iStatus <> 0 then begin SocketError('setsockopt(IP_ADD_MEMBERSHIP)'); Exit; end; So I'm quite sure that it's required for receiving multicast data, but for some reason I'm not receiving anything, as if the implementation in the last snippet has something wrong. Do we know who is the author of this snippet? Thanks again!
×