<?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[CAsynchSocket::Connect() -&amp;gt; WSAEINVAL]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich bastel schon seit Tagen an einem kleinen Tool das ein POP3-Konto im Hintergrund auf neue Mails prüfen soll. Schon bei Connect() komm ich aber nicht weiter, GetLastError() liefert mir bei jedem Aufruf WSAEINVAL zurück:</p>
<pre><code class="language-cpp">...
	m_Socket.Create();
	bSuccess = m_Socket.Connect((LPCTSTR) m_pInfo-&gt;strServer, 110);		// Port 110: POP3
	// Fehlerbehandlung
	if(!bSuccess)
	{
		switch(GetLastError())
		{
...
</code></pre>
<p>Der Hostname stimmt auf jeden Fall (in m_pInfo-&gt;strServer ist &quot;<a href="http://pop.gmx.net" rel="nofollow">pop.gmx.net</a>&quot; gespeichert). AfxSocketInit() wird vorher auch korrekt aufgerufen, und ich hab mir mittlerweile auch schon das CPop3-Beispiel auf Codeproject angeschaut. Trotzdem find ich den Fehler nicht, und hoffe nun jemand von euch kann mir villeicht helfen.</p>
<p>Grüße,<br />
Sascha</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/191936/casynchsocket-connect-gt-wsaeinval</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 23:46:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/191936.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 08 Sep 2007 14:08:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 14:08:57 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich bastel schon seit Tagen an einem kleinen Tool das ein POP3-Konto im Hintergrund auf neue Mails prüfen soll. Schon bei Connect() komm ich aber nicht weiter, GetLastError() liefert mir bei jedem Aufruf WSAEINVAL zurück:</p>
<pre><code class="language-cpp">...
	m_Socket.Create();
	bSuccess = m_Socket.Connect((LPCTSTR) m_pInfo-&gt;strServer, 110);		// Port 110: POP3
	// Fehlerbehandlung
	if(!bSuccess)
	{
		switch(GetLastError())
		{
...
</code></pre>
<p>Der Hostname stimmt auf jeden Fall (in m_pInfo-&gt;strServer ist &quot;<a href="http://pop.gmx.net" rel="nofollow">pop.gmx.net</a>&quot; gespeichert). AfxSocketInit() wird vorher auch korrekt aufgerufen, und ich hab mir mittlerweile auch schon das CPop3-Beispiel auf Codeproject angeschaut. Trotzdem find ich den Fehler nicht, und hoffe nun jemand von euch kann mir villeicht helfen.</p>
<p>Grüße,<br />
Sascha</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361332</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361332</guid><dc:creator><![CDATA[sascha_kib]]></dc:creator><pubDate>Sat, 08 Sep 2007 14:08:57 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 14:20:10 GMT]]></title><description><![CDATA[<p>WSAEINVAL - The parameter s is a listening socket.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361340</guid><dc:creator><![CDATA[-.-]]></dc:creator><pubDate>Sat, 08 Sep 2007 14:20:10 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 14:27:52 GMT]]></title><description><![CDATA[<p>Laut MSDN hab ich aber eine ungültige Adresse angegeben:</p>
<p>WSAEINVAL Invalid host address</p>
<p>...aber die lautet wie gesagt &quot;<a href="http://pop.gmx.net" rel="nofollow">pop.gmx.net</a>&quot; und ist korrekt (in meiner Verzweiflung hab ich es sogar schon über Telnet probiert und damit klappts).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361352</guid><dc:creator><![CDATA[sascha_kib]]></dc:creator><pubDate>Sat, 08 Sep 2007 14:27:52 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 14:29:50 GMT]]></title><description><![CDATA[<p>poste mal einen minimalen, compilierbaren quelltext der den fehler zeigt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361356</guid><dc:creator><![CDATA[........]]></dc:creator><pubDate>Sat, 08 Sep 2007 14:29:50 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 14:58:09 GMT]]></title><description><![CDATA[<p>........ schrieb:</p>
<blockquote>
<p>poste mal einen minimalen, compilierbaren quelltext der den fehler zeigt.</p>
</blockquote>
<p>Das ist mir so leider nicht möglich, den das ganze ist als DLL implementiert und leider ziemlich komplex. Neben den Klassen und Hilfsstrukturen in der DLL müßte ich dann auch noch das zugehörige Beispielprojekt posten, und das würde hier den Rahmen sprengen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Ich könnte also höchstens ein neues Beispielprojekt erzeugen und den relevanten Code dafür anpassen. Dafür bräuchte ich aber auch einige Zeit, und ich bin mir sicher das der Fehler im Prinzip keine komplizierte Sache sein dürfte... wenn man (wie immer) nur weiß wie!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361389</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361389</guid><dc:creator><![CDATA[sascha_kib]]></dc:creator><pubDate>Sat, 08 Sep 2007 14:58:09 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 15:03:03 GMT]]></title><description><![CDATA[<p>Das was ich gepostet hab stammt aus der Hilfe zur Funktion connect aus Winsock die CAsyncSocket natürlich auch benutzt. Such doch mal im ganzen Projekt nach &quot;Listen&quot; vielleicht rufst du es ja versehentlich auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361392</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361392</guid><dc:creator><![CDATA[-.-]]></dc:creator><pubDate>Sat, 08 Sep 2007 15:03:03 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 15:13:39 GMT]]></title><description><![CDATA[<p>Nein, Fehlanzeige. Vor Connect() wird außer Create() eigentlich gar nichts aufgerufen. Vielleicht liegts daran das ich an Create() keine Parameter übergebe, aber im CPop3-Beispiel von Codeproject wird die Funktion genauso aufgerufen. Und an der Socketklasse selbst hab ich außer OnReceive() bis jetzt auch noch nichts überschrieben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361396</guid><dc:creator><![CDATA[sascha_kib]]></dc:creator><pubDate>Sat, 08 Sep 2007 15:13:39 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 15:27:33 GMT]]></title><description><![CDATA[<p>warum setzt du statt &quot;(LPCTSTR) m_pInfo-&gt;strServer&quot; nicht direkt den string ein? nur zum testen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361404</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361404</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Sat, 08 Sep 2007 15:27:33 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 15:33:17 GMT]]></title><description><![CDATA[<p>mr schrieb:</p>
<blockquote>
<p>warum setzt du statt &quot;(LPCTSTR) m_pInfo-&gt;strServer&quot; nicht direkt den string ein? nur zum testen</p>
</blockquote>
<p>Ich hab den String zwar schon im Debugger untersucht, aber es jetzt trotzdem nochmal ausprobiert:</p>
<pre><code class="language-cpp">...
	bSuccess = m_Socket.Connect(_T(&quot;pop.gmx.net&quot;)/*(LPCTSTR) m_pInfo-&gt;strServer*/, 110);
...
</code></pre>
<p>Das Ergebnis ist immer noch dasselbe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361411</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361411</guid><dc:creator><![CDATA[sascha_kib]]></dc:creator><pubDate>Sat, 08 Sep 2007 15:33:17 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 15:37:35 GMT]]></title><description><![CDATA[<p>Ok schade <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Darfst du das Projekt denn weitergeben? Würde gerne mal den Fehler suchen, auch wenn es den Rahmen sprengt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361415</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361415</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Sat, 08 Sep 2007 15:37:35 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 15:42:34 GMT]]></title><description><![CDATA[<p>mr schrieb:</p>
<blockquote>
<p>Ok schade <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Darfst du das Projekt denn weitergeben? Würde gerne mal den Fehler suchen, auch wenn es den Rahmen sprengt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
</blockquote>
<p>Klar darf ich das weitergeben, gib mir einfach deine E-Mail Adresse. Ich schreib das Teil im Prinzip nur weil Sockets noch Neuland für mich sind.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361416</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361416</guid><dc:creator><![CDATA[sascha_kib]]></dc:creator><pubDate>Sat, 08 Sep 2007 15:42:34 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 15:52:26 GMT]]></title><description><![CDATA[<p>Dann schicks mal an <a href="mailto:imgty@arcor.de" rel="nofollow">imgty@arcor.de</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361424</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361424</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Sat, 08 Sep 2007 15:52:26 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 16:07:48 GMT]]></title><description><![CDATA[<p>mr schrieb:</p>
<blockquote>
<p>Dann schicks mal an <a href="mailto:imgty@arcor.de" rel="nofollow">imgty@arcor.de</a></p>
</blockquote>
<p>Ok, hast Post <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361431</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361431</guid><dc:creator><![CDATA[sascha_kib]]></dc:creator><pubDate>Sat, 08 Sep 2007 16:07:48 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 16:29:56 GMT]]></title><description><![CDATA[<p>Ist gut angekommen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Ich kann allerdings deinen Fehler nicht reproduzieren. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> Bei mir gibt GetLastError 10035 (WSAEWOULDBLOCK) zurück - was okay ist.</p>
<p>Ich hab allerdings Visual C++ 2005, du ja Visual C++ 6.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361451</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361451</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Sat, 08 Sep 2007 16:29:56 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 17:08:35 GMT]]></title><description><![CDATA[<p>blockt eventuell eine personal firewall dein programm?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361476</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361476</guid><dc:creator><![CDATA[........]]></dc:creator><pubDate>Sat, 08 Sep 2007 17:08:35 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 18:13:23 GMT]]></title><description><![CDATA[<p>Bei <a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20441">@mr</a> dürfte es wohl tatsächlich an einer Firewall liegen. Bei mir aber nicht, Port 110 ist bei mir komplett offen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361503</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361503</guid><dc:creator><![CDATA[sascha_kib]]></dc:creator><pubDate>Sat, 08 Sep 2007 18:13:23 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 18:53:58 GMT]]></title><description><![CDATA[<blockquote>
<p>Bei <a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20441">@mr</a> dürfte es wohl tatsächlich an einer Firewall liegen.</p>
</blockquote>
<p>Ne, bei mir funktioniert es doch. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
WSAEWOULDBLOCK ist ja kein echter Fehler, sondern nur ein Hinweis.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361522</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361522</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Sat, 08 Sep 2007 18:53:58 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 19:27:42 GMT]]></title><description><![CDATA[<p>Also gibt Connect() bei Dir TRUE zurück? Ich glaub dann teste ich das morgen nochmal auf einem anderen Rechner. Falls es am Rechner liegen sollte, versteh ich allerdings nicht wieso das CPop3-Beispiel von Codeproject bei mir läuft, denn im Prinzip macht das auch nichts anderes.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361540</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361540</guid><dc:creator><![CDATA[sascha_kib]]></dc:creator><pubDate>Sat, 08 Sep 2007 19:27:42 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sat, 08 Sep 2007 19:33:19 GMT]]></title><description><![CDATA[<p>Nein, Connect gibt FALSE zurück.</p>
<blockquote>
<p>Nonzero if the function is successful; otherwise 0, and a specific error code can be retrieved by calling GetLastError. If this indicates an error code of WSAEWOULDBLOCK, and your application is using the overridable callbacks, your application will receive an OnConnect message when the connect operation is complete.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1361544</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361544</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Sat, 08 Sep 2007 19:33:19 GMT</pubDate></item><item><title><![CDATA[Reply to CAsynchSocket::Connect() -&amp;gt; WSAEINVAL on Sun, 09 Sep 2007 09:50:35 GMT]]></title><description><![CDATA[<p>Jetzt hab ich das Problem gefunden. Meine Firewall war zwar richtig eingestellt, aber erst nachdem ich sie jetzt mal komplett deaktiviert hatte, läuft auch mein Programm. Mittlerweile hab ich sie wieder eingeschaltet und nun läuft es immer noch korrekt.</p>
<p>Vielleicht sollte ich mich mal bei Microsoft bedanken <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
<p>Danke das Du Dir die Mühe gemacht und das ganze getestet hast <a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20441">@mr</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1361749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1361749</guid><dc:creator><![CDATA[sascha_kib]]></dc:creator><pubDate>Sun, 09 Sep 2007 09:50:35 GMT</pubDate></item></channel></rss>