<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8943">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">utils_socket: Set option to reuse socket<br><br>If the socket (the one found to be available) was not torn down fast enough<br>then SIPp could report an "in use" error. This patch sets the reuse address<br>option on the socket. This should allow another binding to take place for<br>the same address:port combination if the socket is in the TIME_WAIT state,<br>which it should be after closing, but waiting on the OS.<br><br>Change-Id: I5eb84e77c8825310f1c10f21c54b19c4ed694175<br>---<br>M lib/python/asterisk/utils_socket.py<br>1 file changed, 3 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/43/8943/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/lib/python/asterisk/utils_socket.py b/lib/python/asterisk/utils_socket.py<br>index 158592d..ccbc2cc 100644<br>--- a/lib/python/asterisk/utils_socket.py<br>+++ b/lib/python/asterisk/utils_socket.py<br>@@ -73,6 +73,9 @@<br> res = 0<br> s = socket(family, socktype)<br> try:<br>+ # Set SO_REUSEADDR on the socket. This should allow others<br>+ # to bind the same address:port if the socket is in TIME_WAIT<br>+ s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)<br> s.bind((host, port))<br> res = s.getsockname()[1]<br> except error as e:<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8943">change 8943</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8943"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I5eb84e77c8825310f1c10f21c54b19c4ed694175 </div>
<div style="display:none"> Gerrit-Change-Number: 8943 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>