https://github.com/bk138/multicast-client-server-example
This is a simple educational example of an IPv4/IPv6 multicast client and server, running under UNIX and Win32.
https://github.com/bk138/multicast-client-server-example
cross-platform example linux macos multicast windows windows-ce
Last synced: about 2 months ago
JSON representation
This is a simple educational example of an IPv4/IPv6 multicast client and server, running under UNIX and Win32.
- Host: GitHub
- URL: https://github.com/bk138/multicast-client-server-example
- Owner: bk138
- License: gpl-2.0
- Created: 2010-01-09T17:24:38.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2023-04-30T06:44:01.000Z (over 2 years ago)
- Last Synced: 2025-04-10T00:13:42.323Z (6 months ago)
- Topics: cross-platform, example, linux, macos, multicast, windows, windows-ce
- Language: C
- Homepage:
- Size: 56.6 KB
- Stars: 59
- Watchers: 7
- Forks: 25
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: COPYING
- Authors: AUTHORS
Awesome Lists containing this project
README
[](https://github.com/bk138/Multicast-Client-Server-Example/actions/workflows/ci.yml)
[](https://liberapay.com/bk138/donate)
[](https://www.patreon.com/bk138)This is a simple educational example of a multicast
client and server, running under UNIX and Win32.# Building
To compile, usemkdir build
cd build
cmake ..
cmake --build .## Crosscompiling from Unix to Android
See https://developer.android.com/ndk/guides/cmake.html as a reference, but
basically it boils down to adding `-DANDROID_NDK= -DCMAKE_TOOLCHAIN_FILE= -DANDROID_NATIVE_API_LEVEL=`
to the `cmake ..` step above.# Troubleshooting
If there is no data coming through when client and server are on different
machines, the reason can be that IP routing is configured in a way that routes
multicast traffic to or expects multicast traffic from an interface the other
machine is not connected to (the sample programs in this repo do not use the
`IP_MULTICAST_IF` setsockopt() call yet as it's not cross-platform).
In this case, you have to add a static route to the client and/or server machine's
routing table indicating the interface for multicast traffic. The internet has
lots of examples.