mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added a method to DatagramSocket to set whether multicast loopback should be enabled
This commit is contained in:
parent
934d5aee22
commit
ea23ddd69e
2 changed files with 16 additions and 2 deletions
|
|
@ -741,6 +741,14 @@ bool DatagramSocket::leaveMulticast (const String& multicastIPAddress)
|
|||
return SocketHelpers::multicast (handle, multicastIPAddress, lastBindAddress, false);
|
||||
}
|
||||
|
||||
bool DatagramSocket::setMulticastLoopbackEnabled (bool enable)
|
||||
{
|
||||
if (! isBound || handle < 0)
|
||||
return false;
|
||||
|
||||
return SocketHelpers::setOption<bool> (handle, IPPROTO_IP, IP_MULTICAST_LOOP, enable);
|
||||
}
|
||||
|
||||
bool DatagramSocket::setEnablePortReuse (bool enabled)
|
||||
{
|
||||
#if JUCE_ANDROID
|
||||
|
|
|
|||
|
|
@ -315,18 +315,24 @@ public:
|
|||
void shutdown();
|
||||
|
||||
//==============================================================================
|
||||
/** Join a multicast group
|
||||
/** Join a multicast group.
|
||||
|
||||
@returns true if it succeeds.
|
||||
*/
|
||||
bool joinMulticast (const String& multicastIPAddress);
|
||||
|
||||
/** Leave a multicast group
|
||||
/** Leave a multicast group.
|
||||
|
||||
@returns true if it succeeds.
|
||||
*/
|
||||
bool leaveMulticast (const String& multicastIPAddress);
|
||||
|
||||
/** Enables or disables multicast loopback.
|
||||
|
||||
@returns true if it succeeds.
|
||||
*/
|
||||
bool setMulticastLoopbackEnabled (bool enableLoopback);
|
||||
|
||||
//==============================================================================
|
||||
/** Allow other applications to re-use the port.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue