diff options
author | kurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597> | 2013-05-31 21:47:25 +0000 |
---|---|---|
committer | kurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597> | 2013-05-31 21:47:25 +0000 |
commit | 5a87247fdf2768a6408e0b87c210cebda85bc996 (patch) | |
tree | b538e7e42f8a7ba6c53e1b0bc22bfb359b1e0ef9 /CommonLibs/Sockets.cpp | |
parent | bec41039bf2ec07c04a6e8b0b586b085ab9cd74c (diff) |
syncing commonlibs with Many thanks to Michael Iedema for these patches, makes config a lot better.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5655 19bc5d8c-e614-43d4-8b26-e1612bc8e597
Diffstat (limited to 'CommonLibs/Sockets.cpp')
-rw-r--r-- | CommonLibs/Sockets.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CommonLibs/Sockets.cpp b/CommonLibs/Sockets.cpp index dc110c8..dd7527c 100644 --- a/CommonLibs/Sockets.cpp +++ b/CommonLibs/Sockets.cpp @@ -41,6 +41,10 @@ #include <stdlib.h> + + + + bool resolveAddress(struct sockaddr_in *address, const char *hostAndPort) { assert(address); @@ -255,6 +259,11 @@ void UDPSocket::open(unsigned short localPort) throw SocketError(); } + // pat added: This lets the socket be reused immediately, which is needed if OpenBTS crashes. + int on = 1; + setsockopt(mSocketFD, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + + // bind struct sockaddr_in address; size_t length = sizeof(address); |