mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-09 18:45:22 +02:00
fix bad network lib broadcast implementation
This commit is contained in:
@ -93,12 +93,6 @@ namespace net {
|
||||
*/
|
||||
void setPort(int port);
|
||||
|
||||
/**
|
||||
* Check if the address is multicast.
|
||||
* @return True if multicast, false if not.
|
||||
*/
|
||||
bool isMulticast() const;
|
||||
|
||||
struct sockaddr_in addr;
|
||||
};
|
||||
|
||||
@ -256,7 +250,7 @@ namespace net {
|
||||
* @param laddr Local address to bind the socket to.
|
||||
* @return Socket instance on success, Throws runtime_error otherwise.
|
||||
*/
|
||||
std::shared_ptr<Socket> openudp(const Address& raddr, const Address& laddr);
|
||||
std::shared_ptr<Socket> openudp(const Address& raddr, const Address& laddr, bool allowBroadcast = false);
|
||||
|
||||
/**
|
||||
* Create UDP socket.
|
||||
@ -265,24 +259,24 @@ namespace net {
|
||||
* @param laddr Local address to bind the socket to.
|
||||
* @return Socket instance on success, Throws runtime_error otherwise.
|
||||
*/
|
||||
std::shared_ptr<Socket> openudp(std::string rhost, int rport, const Address& laddr);
|
||||
std::shared_ptr<Socket> openudp(std::string rhost, int rport, const Address& laddr, bool allowBroadcast = false);
|
||||
|
||||
/**
|
||||
* Create UDP socket.
|
||||
* @param raddr Remote address. Set to a multicast address to allow multicast.
|
||||
* @param raddr Remote address. Set to a multicast or broadcast address to allow multicast.
|
||||
* @param lhost Local hostname or IP used to bind the socket (optional, "0.0.0.0" for Any).
|
||||
* @param lpost Local port used to bind the socket to (optional, 0 to allocate automatically).
|
||||
* @return Socket instance on success, Throws runtime_error otherwise.
|
||||
*/
|
||||
std::shared_ptr<Socket> openudp(const Address& raddr, std::string lhost = "0.0.0.0", int lport = 0);
|
||||
std::shared_ptr<Socket> openudp(const Address& raddr, std::string lhost = "0.0.0.0", int lport = 0, bool allowBroadcast = false);
|
||||
|
||||
/**
|
||||
* Create UDP socket.
|
||||
* @param rhost Remote hostname or IP address. Set to a multicast address to allow multicast.
|
||||
* @param rhost Remote hostname or IP address. Set to a multicast or broadcast address to allow multicast.
|
||||
* @param rport Remote port.
|
||||
* @param lhost Local hostname or IP used to bind the socket (optional, "0.0.0.0" for Any).
|
||||
* @param lpost Local port used to bind the socket to (optional, 0 to allocate automatically).
|
||||
* @return Socket instance on success, Throws runtime_error otherwise.
|
||||
*/
|
||||
std::shared_ptr<Socket> openudp(std::string rhost, int rport, std::string lhost = "0.0.0.0", int lport = 0);
|
||||
std::shared_ptr<Socket> openudp(std::string rhost, int rport, std::string lhost = "0.0.0.0", int lport = 0, bool allowBroadcast = false);
|
||||
}
|
Reference in New Issue
Block a user