NetSocketAddr doesn't need a socket, so don't accept it
This commit is contained in:
parent
e38d5bf8c7
commit
c1fa7c07c6
3 changed files with 6 additions and 6 deletions
src
|
@ -112,8 +112,8 @@ extern void NetExit();
|
|||
|
||||
/// Resolve host in name or or colon dot notation.
|
||||
extern unsigned long NetResolveHost(const std::string &host);
|
||||
/// Get local IP from network file descriptor
|
||||
extern int NetSocketAddr(const Socket sock, unsigned long *ips, int maxAddr);
|
||||
/// Get local IPs
|
||||
extern int NetSocketAddr(unsigned long *ips, int maxAddr);
|
||||
|
||||
/// Open a UDP Socket port. (param in network format)
|
||||
extern Socket NetOpenUDP(unsigned long ip, int port);
|
||||
|
|
|
@ -219,7 +219,7 @@ unsigned long NetResolveHost(const std::string &host)
|
|||
#ifndef MIB_IF_TYPE_IEEE80211
|
||||
#define MIB_IF_TYPE_IEEE80211 71
|
||||
#endif
|
||||
int NetSocketAddr(const Socket sock, unsigned long *ips, int maxAddr)
|
||||
int NetSocketAddr(unsigned long *ips, int maxAddr)
|
||||
{
|
||||
int idx = 0;
|
||||
PIP_ADAPTER_ADDRESSES pAddresses = NULL;
|
||||
|
@ -245,7 +245,7 @@ int NetSocketAddr(const Socket sock, unsigned long *ips, int maxAddr)
|
|||
return idx;
|
||||
}
|
||||
#elif defined(USE_LINUX) || defined(USE_MAC)
|
||||
int NetSocketAddr(const Socket sock, unsigned long *ips, int maxAddr)
|
||||
int NetSocketAddr(unsigned long *ips, int maxAddr)
|
||||
{
|
||||
struct ifaddrs *ifAddrStruct = NULL;
|
||||
struct ifaddrs *ifa = NULL;
|
||||
|
@ -268,7 +268,7 @@ int NetSocketAddr(const Socket sock, unsigned long *ips, int maxAddr)
|
|||
}
|
||||
#else // } {
|
||||
// more??
|
||||
int NetSocketAddr(const Socket sock, unsigned long *ips, int maxAddr)
|
||||
int NetSocketAddr(unsigned long *ips, int maxAddr)
|
||||
{
|
||||
ips[0] = htonl(0x7f000001);
|
||||
return 1;
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
void SetNonBlocking() { NetSetNonBlocking(socket); }
|
||||
int HasDataToRead(int timeout) { return NetSocketReady(socket, timeout); }
|
||||
bool IsValid() const { return socket != Socket(-1); }
|
||||
int GetSocketAddresses(unsigned long *ips, int maxAddr) { return NetSocketAddr(socket, ips, maxAddr); }
|
||||
int GetSocketAddresses(unsigned long *ips, int maxAddr) { return NetSocketAddr(ips, maxAddr); }
|
||||
private:
|
||||
Socket socket;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue