<?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[10045 Winsocks]]></title><description><![CDATA[<p>Hi,</p>
<p>also ich kriege gerade immer den fehler 10045 bei meinem recv und verzweifle langsam...</p>
<pre><code class="language-cpp">#define MSG_WAITALL 0x8
</code></pre>
<p>meine funktion zum empfangen</p>
<pre><code class="language-cpp">WinSock * Sock = (WinSock *)lParam;
  ByteBuffer Buffer;
  ZeroMemory(&amp;Buffer,sizeof(ByteBuffer));
  MyList * List = Sock-&gt;List;
  SOCKET * ClientS = ((SOCKET *)(List-&gt;Object));
  while (Sock-&gt;getState()){
    if ( recv(*ClientS,Buffer.getBaseAdress(),BUFFER_SIZE,MSG_WAITALL) == SOCKET_ERROR ){
      printf( &quot;ERROR in recv(..) : %d\n&quot;, WSAGetLastError());
    }else{
      Sock-&gt;MessageHandler-&gt;ProcessMessage(Buffer.getBaseAdress(),true);
    }
  }
  return 1;
</code></pre>
<p>meine funktion zum verbinden</p>
<pre><code class="language-cpp">SOCKET * Client = new SOCKET;                                       
  *Client = accept(AcceptSocket,NULL,NULL);
  if ( *Client == INVALID_SOCKET ){
    printf(&quot;ERROR: Accept() : %d\n&quot;,WSAGetLastError());
    delete Client;
    return 0;
  }else{
    sockaddr_in Addr;
    int len = sizeof Addr;
    if ( getpeername(*Client, (sockaddr*)&amp;Addr, &amp;len) != 0 ){
      printf(&quot;Cannot Recieve the Peer Name, ERROR: %d\n&quot;,WSAGetLastError());
    }
    DWORD Dump;
    MyList * List = Sock-&gt;List-&gt;GetLast();
    printf(&quot;Neue Verbindung akzeptiert. IP: %s PORT: %d\n&quot;, inet_ntoa(Addr.sin_addr), ntohs(Addr.sin_port) );
    List-&gt;Object  = (PVOID)Client;
    HANDLE * hThread = new HANDLE;
    *hThread = CreateThread( NULL, NULL, RecieveThread, (PVOID)Sock, NULL, &amp;Dump );
    List-&gt;hObject = (PVOID)hThread;
    Sock-&gt;List-&gt;Add();
    return 1;
  }
</code></pre>
<p>der client ist nen ganz einfacher...</p>
<pre><code class="language-cpp">WORD Version = MAKEWORD(2,0);           // Version 2.0
WSADATA wsa;                            // Wird mit den Daten des installierten Winsocks gefüllt.
ZeroMemory(&amp;wsa,sizeof(WSADATA));       // Initialisieren
if ( !(!WSAStartup(MAKEWORD(2,0),&amp;wsa)) ){ // Startet Winsocks :D
        printf(&quot;ERROR: Couldnt intialize WinSocks 2.0\n&quot;);
        printf(&quot;Closing...\n&quot;);
        return 0;
        }
printf(&quot;WinSocks Gestartet !!!\n&quot;);
// Sockets.
SOCKET s;
ZeroMemory(&amp;s,sizeof(SOCKET));
s = socket(AF_INET,SOCK_STREAM,0);
if ( s == INVALID_SOCKET ){
        printf(&quot;ERROR: SOCKET: %d\n&quot;, WSAGetLastError());
        printf(&quot;Closing...\n&quot;);
        return 1;
        }else{
        printf(&quot;Socket Erstellt.\n&quot;);
        }
printf(&quot;Verbinde...\n&quot;);
SOCKADDR_IN si;
ZeroMemory(&amp;si,sizeof(SOCKADDR_IN));
si.sin_family = AF_INET;
si.sin_port = htons(SERVER_PORT);
si.sin_addr.s_addr=inet_addr(&quot;127.0.0.1&quot;); // zielrechner ist unser eigener

if ( connect(s, (SOCKADDR*)&amp;si,sizeof(SOCKADDR)) == SOCKET_ERROR ){
        printf(&quot;ERROR: Connect: %d\n&quot;,WSAGetLastError());
        printf(&quot;Closing...\n&quot;);
        return 1;
        }else{
        printf(&quot;Verbunden mit 127.0.0.1\n&quot;);
        }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/222646/10045-winsocks</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 14:35:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/222646.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 Sep 2008 17:15:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 10045 Winsocks on Mon, 15 Sep 2008 17:21:30 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>also ich kriege gerade immer den fehler 10045 bei meinem recv und verzweifle langsam...</p>
<pre><code class="language-cpp">#define MSG_WAITALL 0x8
</code></pre>
<p>meine funktion zum empfangen</p>
<pre><code class="language-cpp">WinSock * Sock = (WinSock *)lParam;
  ByteBuffer Buffer;
  ZeroMemory(&amp;Buffer,sizeof(ByteBuffer));
  MyList * List = Sock-&gt;List;
  SOCKET * ClientS = ((SOCKET *)(List-&gt;Object));
  while (Sock-&gt;getState()){
    if ( recv(*ClientS,Buffer.getBaseAdress(),BUFFER_SIZE,MSG_WAITALL) == SOCKET_ERROR ){
      printf( &quot;ERROR in recv(..) : %d\n&quot;, WSAGetLastError());
    }else{
      Sock-&gt;MessageHandler-&gt;ProcessMessage(Buffer.getBaseAdress(),true);
    }
  }
  return 1;
</code></pre>
<p>meine funktion zum verbinden</p>
<pre><code class="language-cpp">SOCKET * Client = new SOCKET;                                       
  *Client = accept(AcceptSocket,NULL,NULL);
  if ( *Client == INVALID_SOCKET ){
    printf(&quot;ERROR: Accept() : %d\n&quot;,WSAGetLastError());
    delete Client;
    return 0;
  }else{
    sockaddr_in Addr;
    int len = sizeof Addr;
    if ( getpeername(*Client, (sockaddr*)&amp;Addr, &amp;len) != 0 ){
      printf(&quot;Cannot Recieve the Peer Name, ERROR: %d\n&quot;,WSAGetLastError());
    }
    DWORD Dump;
    MyList * List = Sock-&gt;List-&gt;GetLast();
    printf(&quot;Neue Verbindung akzeptiert. IP: %s PORT: %d\n&quot;, inet_ntoa(Addr.sin_addr), ntohs(Addr.sin_port) );
    List-&gt;Object  = (PVOID)Client;
    HANDLE * hThread = new HANDLE;
    *hThread = CreateThread( NULL, NULL, RecieveThread, (PVOID)Sock, NULL, &amp;Dump );
    List-&gt;hObject = (PVOID)hThread;
    Sock-&gt;List-&gt;Add();
    return 1;
  }
</code></pre>
<p>der client ist nen ganz einfacher...</p>
<pre><code class="language-cpp">WORD Version = MAKEWORD(2,0);           // Version 2.0
WSADATA wsa;                            // Wird mit den Daten des installierten Winsocks gefüllt.
ZeroMemory(&amp;wsa,sizeof(WSADATA));       // Initialisieren
if ( !(!WSAStartup(MAKEWORD(2,0),&amp;wsa)) ){ // Startet Winsocks :D
        printf(&quot;ERROR: Couldnt intialize WinSocks 2.0\n&quot;);
        printf(&quot;Closing...\n&quot;);
        return 0;
        }
printf(&quot;WinSocks Gestartet !!!\n&quot;);
// Sockets.
SOCKET s;
ZeroMemory(&amp;s,sizeof(SOCKET));
s = socket(AF_INET,SOCK_STREAM,0);
if ( s == INVALID_SOCKET ){
        printf(&quot;ERROR: SOCKET: %d\n&quot;, WSAGetLastError());
        printf(&quot;Closing...\n&quot;);
        return 1;
        }else{
        printf(&quot;Socket Erstellt.\n&quot;);
        }
printf(&quot;Verbinde...\n&quot;);
SOCKADDR_IN si;
ZeroMemory(&amp;si,sizeof(SOCKADDR_IN));
si.sin_family = AF_INET;
si.sin_port = htons(SERVER_PORT);
si.sin_addr.s_addr=inet_addr(&quot;127.0.0.1&quot;); // zielrechner ist unser eigener

if ( connect(s, (SOCKADDR*)&amp;si,sizeof(SOCKADDR)) == SOCKET_ERROR ){
        printf(&quot;ERROR: Connect: %d\n&quot;,WSAGetLastError());
        printf(&quot;Closing...\n&quot;);
        return 1;
        }else{
        printf(&quot;Verbunden mit 127.0.0.1\n&quot;);
        }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1582353</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582353</guid><dc:creator><![CDATA[Schurke]]></dc:creator><pubDate>Mon, 15 Sep 2008 17:21:30 GMT</pubDate></item><item><title><![CDATA[Reply to 10045 Winsocks on Mon, 15 Sep 2008 17:37:09 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-14199.html" rel="nofollow">Phoemuex</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1582374</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582374</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 15 Sep 2008 17:37:09 GMT</pubDate></item><item><title><![CDATA[Reply to 10045 Winsocks on Mon, 15 Sep 2008 17:39:10 GMT]]></title><description><![CDATA[<blockquote>
<p>WSAEOPNOTSUPP<br />
10045</p>
<p>Operation not supported.</p>
<p>The attempted operation is not supported for the type of object referenced. Usually this occurs when a socket descriptor to a socket that cannot support this operation is trying to accept a connection on a datagram socket.</p>
</blockquote>
<p>versuchs mal ohne MSG_WAITALL</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1582379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582379</guid><dc:creator><![CDATA[gosha16]]></dc:creator><pubDate>Mon, 15 Sep 2008 17:39:10 GMT</pubDate></item><item><title><![CDATA[Reply to 10045 Winsocks on Mon, 15 Sep 2008 17:56:42 GMT]]></title><description><![CDATA[<p>Geht &lt;.&lt; ist das ürgentwie anders möglich zu relisieren das er ganze datenpackete empfängt und nicht bei ner 0 sagt &quot;des isch fertig&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1582392</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582392</guid><dc:creator><![CDATA[Schurke]]></dc:creator><pubDate>Mon, 15 Sep 2008 17:56:42 GMT</pubDate></item><item><title><![CDATA[Reply to 10045 Winsocks on Mon, 15 Sep 2008 19:26:26 GMT]]></title><description><![CDATA[<p>benutz mal bisschen die SuFu, da findeste fertige lösungen, damit du alles empfängst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1582452</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582452</guid><dc:creator><![CDATA[gosha16]]></dc:creator><pubDate>Mon, 15 Sep 2008 19:26:26 GMT</pubDate></item></channel></rss>