<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Socket WSAG-Error: 10048]]></title><description><![CDATA[<p>Hey,</p>
<p>mein Programm läuft zwar vollständig, doch wird ein Socket nicht gebunde.</p>
<pre><code class="language-cpp">rc=bind(acceptSocket,(SOCKADDR*)&amp;addr,sizeof(SOCKADDR_IN));
    if(rc==SOCKET_ERROR) {
      printf(&quot;Error, bind() failed: %d\n&quot;,WSAGetLastError());
      return 1;
   }
</code></pre>
<p>Wie kann ich soetwas verhindern?<br />
Zu dem Fehlercode fand ich:</p>
<pre><code>/*
   WSAEADDRINUSE (10048)
   Address already in use.
   Typically, only one usage of each socket address (protocol/IP address/port) is permitted. This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket, or a socket that wasn't closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using setsockopt(SO_REUSEADDR). Client applications usually need not call bind at all?connect chooses an unused port automatically. When bind is called with a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error could be delayed until the specific address is committed. This could happen with a call to another function later, including connect, listen, WSAConnect, or WSAJoinLeaf.
   */
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/232843/socket-wsag-error-10048</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 08:42:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/232843.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Jan 2009 00:02:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Socket WSAG-Error: 10048 on Wed, 28 Jan 2009 00:02:52 GMT]]></title><description><![CDATA[<p>Hey,</p>
<p>mein Programm läuft zwar vollständig, doch wird ein Socket nicht gebunde.</p>
<pre><code class="language-cpp">rc=bind(acceptSocket,(SOCKADDR*)&amp;addr,sizeof(SOCKADDR_IN));
    if(rc==SOCKET_ERROR) {
      printf(&quot;Error, bind() failed: %d\n&quot;,WSAGetLastError());
      return 1;
   }
</code></pre>
<p>Wie kann ich soetwas verhindern?<br />
Zu dem Fehlercode fand ich:</p>
<pre><code>/*
   WSAEADDRINUSE (10048)
   Address already in use.
   Typically, only one usage of each socket address (protocol/IP address/port) is permitted. This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket, or a socket that wasn't closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using setsockopt(SO_REUSEADDR). Client applications usually need not call bind at all?connect chooses an unused port automatically. When bind is called with a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error could be delayed until the specific address is committed. This could happen with a call to another function later, including connect, listen, WSAConnect, or WSAJoinLeaf.
   */
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1653585</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1653585</guid><dc:creator><![CDATA[Weinen]]></dc:creator><pubDate>Wed, 28 Jan 2009 00:02:52 GMT</pubDate></item><item><title><![CDATA[Reply to Socket WSAG-Error: 10048 on Wed, 28 Jan 2009 00:05:20 GMT]]></title><description><![CDATA[<p>Der Fehlercode ist so nicht übersichtlich. Hier nochmals:</p>
<blockquote>
<p><em>WSAEADDRINUSE (10048)</em><br />
<strong>Address already in use.</strong><br />
Typically, only one usage of each socket address (protocol/IP address/port) is permitted.<br />
This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket,<br />
or a socket that wasn't closed properly, or one that is still in the process of closing.<br />
For server applications that need to bind multiple sockets to the same port number, consider using setsockopt(SO_REUSEADDR).<br />
Client applications usually need not call bind at all?connect chooses an unused port automatically.<br />
When bind is called with a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error could be delayed until the specific address is committed.<br />
This could happen with a call to another function later, including connect, listen, WSAConnect, or WSAJoinLeaf.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1653587</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1653587</guid><dc:creator><![CDATA[Weinen]]></dc:creator><pubDate>Wed, 28 Jan 2009 00:05:20 GMT</pubDate></item><item><title><![CDATA[Reply to Socket WSAG-Error: 10048 on Thu, 29 Jan 2009 11:25:06 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie dieser Fehler verhindert werden kann ist nicht &quot;so einfach&quot; zu sagen,<br />
nachfolgend ist einmal aufgeführt wie ich diese Bereiche immer ausführe:</p>
<pre><code class="language-cpp">int                   flag_bind;
SOCKET                my_socket;
struct sockaddr_in    my_address;
struct servent        *service_info;

service_info = getservbyname( &quot;socket&quot;, &quot;tcp&quot; );

my_address.sin_family      = AF_INET;
my_address.sin_port        = service_info-&gt;port;
my_address.sin_addr.s_addr = INADDR_ANY;

flag_bind = bind( my_socket, (struct sockaddr *)&amp;my_address, sizeof(my_address) );
</code></pre>
<p>... und immer daran denken das Sockets nicht nur geöffnet sondern auch<br />
geschlossen werden müssen, vielleicht hilft das Vorstehende etwas.</p>
<p>mfG ZZR-1100</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1654287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1654287</guid><dc:creator><![CDATA[ZZR-1100]]></dc:creator><pubDate>Thu, 29 Jan 2009 11:25:06 GMT</pubDate></item></channel></rss>