Index: src/platform-macos.cc |
=================================================================== |
--- src/platform-macos.cc (revision 1552) |
+++ src/platform-macos.cc (working copy) |
@@ -593,6 +593,8 @@ |
int Send(const char* data, int len) const; |
int Receive(char* data, int len) const; |
+ bool SetReuseAddress(bool reuse_address); |
+ |
bool IsValid() const { return socket_ != -1; } |
private: |
@@ -695,6 +697,13 @@ |
} |
+bool MacOSSocket::SetReuseAddress(bool reuse_address) { |
+ int on = reuse_address ? 1 : 0; |
+ int status = setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); |
+ return status == 0; |
+} |
+ |
+ |
bool Socket::Setup() { |
// Nothing to do on MacOS. |
return true; |