<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem re-using address on socket in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051398#M88064</link>
    <description>The bind error is usually cause when the port number is already in use. If a program is binded to a particular port and the process is terminated abnormally, then the port is still not released by the process. hence while running the process again the binding error pops up. In such case re-logging in may work or check the background process. &lt;BR /&gt;&lt;BR /&gt;You can also use the command netstat to check for all available port. If the port number your process using does not exist, then itâ  s sure to get a bind error.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Kind Regards&lt;BR /&gt;Manoj Kumar</description>
    <pubDate>Wed, 10 Mar 2004 03:10:02 GMT</pubDate>
    <dc:creator>Manoj Kumar A</dc:creator>
    <dc:date>2004-03-10T03:10:02Z</dc:date>
    <item>
      <title>Problem re-using address on socket</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051392#M88058</link>
      <description>I have a socket problem on Red Hat Linux 8.0.  The basic operation of the socket works fine, but under certain circumstances, it is necessary to close the socket and start all over again.  When I try to bind() to the same IP address and port number the second time, it fails with EADDRINUSE, despite the fact that I've already called setsockopt() with SO_REUSEADDR.  Is it necessary to do anything else other than call setsockopt()?</description>
      <pubDate>Mon, 18 Aug 2003 22:37:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051392#M88058</guid>
      <dc:creator>Donald Crook</dc:creator>
      <dc:date>2003-08-18T22:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem re-using address on socket</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051393#M88059</link>
      <description>You may also have to set SO_REUSEPORT. In fact that may be the only thing reuquired. SO_REUSEADDR might not be required.&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Tue, 19 Aug 2003 18:17:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051393#M88059</guid>
      <dc:creator>Brian Bergstrand</dc:creator>
      <dc:date>2003-08-19T18:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem re-using address on socket</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051394#M88060</link>
      <description>Good thought, but it appears that Red Hat does not support that socket option.  The file /usr/include/asm/socket.h contains the line:  /*To add :#define SO_REUSEPORT 15 */.  When I uncommented that line and recompiled, the call to setsockopt() failed with ENOPROTOOPT.&lt;BR /&gt;&lt;BR /&gt;--Don</description>
      <pubDate>Tue, 19 Aug 2003 21:57:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051394#M88060</guid>
      <dc:creator>Donald Crook</dc:creator>
      <dc:date>2003-08-19T21:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem re-using address on socket</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051395#M88061</link>
      <description>Well, I did some digging and found out that SO_REUSEADDR on Linux will allow reuse of a host:port pair; so if you are binding to all interfaces (0.0.0.0), you may need to specify a specific interface address. I'm not really sure. I also learned that the kernel may end up hanging onto a port longer than necessary which would prevent re-binding.&lt;BR /&gt;&lt;BR /&gt;You could also check out the 2.6 kernel and see if support was added for SO_REUSEPORT.&lt;BR /&gt;&lt;BR /&gt;FWIW, I had this same problem on a BSD variant, and the only thing that fixed it was SO_REUSEPORT.&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Wed, 20 Aug 2003 11:15:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051395#M88061</guid>
      <dc:creator>Brian Bergstrand</dc:creator>
      <dc:date>2003-08-20T11:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem re-using address on socket</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051396#M88062</link>
      <description>check ephemeral ports range on your system. On a linux box this can be done by looking in '/proc/sys/net/ipv4/ip_local_port_range'.&lt;BR /&gt;&lt;BR /&gt;$&amp;gt;cat /proc/sys/net/ipv4/ip_local_port_range&lt;BR /&gt;&lt;BR /&gt;set this range if you find the existing range too low.</description>
      <pubDate>Fri, 07 Nov 2003 06:15:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051396#M88062</guid>
      <dc:creator>aniruddh75</dc:creator>
      <dc:date>2003-11-07T06:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem re-using address on socket</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051397#M88063</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try close() system call to close the socket gracefully.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;U.SivaKumar.</description>
      <pubDate>Fri, 07 Nov 2003 10:56:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051397#M88063</guid>
      <dc:creator>U.SivaKumar_2</dc:creator>
      <dc:date>2003-11-07T10:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem re-using address on socket</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051398#M88064</link>
      <description>The bind error is usually cause when the port number is already in use. If a program is binded to a particular port and the process is terminated abnormally, then the port is still not released by the process. hence while running the process again the binding error pops up. In such case re-logging in may work or check the background process. &lt;BR /&gt;&lt;BR /&gt;You can also use the command netstat to check for all available port. If the port number your process using does not exist, then itâ  s sure to get a bind error.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Kind Regards&lt;BR /&gt;Manoj Kumar</description>
      <pubDate>Wed, 10 Mar 2004 03:10:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051398#M88064</guid>
      <dc:creator>Manoj Kumar A</dc:creator>
      <dc:date>2004-03-10T03:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem re-using address on socket</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051399#M88065</link>
      <description>This is bascially bcos the port is tiil not released by the kernel.So use close() or _close(). If this also does not work just try running a relatively big process forcing the kernel to release all the connections.</description>
      <pubDate>Wed, 24 Mar 2004 00:19:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-re-using-address-on-socket/m-p/3051399#M88065</guid>
      <dc:creator>Guru Dutta</dc:creator>
      <dc:date>2004-03-24T00:19:26Z</dc:date>
    </item>
  </channel>
</rss>

