<?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[Winsocket Error.]]></title><description><![CDATA[<p>Hab gester angefangen ein kleinens Netzwerk prog. zu basteln jedoch steh ich zu zeit an.<br />
Mein Ziel ist es eine Verbindung von meinen Laptop win[XP] zu meinen Stand-Pc windows 7 herzustellen.</p>
<p>Wenn ich das server und das client prog. auf meinen pc laufen lasse funktioniert es problemlos.<br />
Sobalt ich es jedoch über Lan probiere gibt mir accept() kein return!</p>
<p>Firewall ist bei beiden aus.</p>
<p>Server bzw. Client</p>
<pre><code class="language-cpp">#include&lt;WinSock.h&gt;
#include&lt;Windows.h&gt;
#include&lt;iostream&gt;

using namespace std;

int main()
{

	 printf(&quot;WINSOCK TUT\n\n\n&quot;);

     WSADATA WsaDat;

      if (WSAStartup(MAKEWORD(1, 1), &amp;WsaDat) != 0)

            {

             printf(&quot;WSA Initialization failed.&quot;);

            } 
	  else printf(&quot;WINSOCKET is Initializet successful\n\n&quot;);

	  SOCKET Socket;

	 Socket=socket(AF_INET,SOCK_STREAM,NULL);

	 if(Socket==INVALID_SOCKET) printf(&quot;SOCKET failed.&quot;);
	 else printf(&quot;Socket INIT successful\n\n&quot;);

sockaddr_in sockAddr;

sockAddr.sin_family = AF_INET;
sockAddr.sin_port =50;
sockAddr.sin_addr.S_un.S_addr= INADDR_ANY;

if(bind(Socket,(SOCKADDR*)&amp;sockAddr,sizeof(sockAddr))==SOCKET_ERROR) printf(&quot;Error Binding\n\n&quot;);
else printf(&quot;Binding sucessfull\n\n&quot;);

if(listen(Socket,1)==SOCKET_ERROR) printf(&quot;Error with Listing\n\n&quot;);
else printf(&quot;Socket is Listining\n\n&quot;);

printf(&quot;Server is weiting for Clients.......\n&quot;);
printf(&quot;Run Client Programm!!\n\n&quot;);

SOCKET TempSocket=0;

while(TempSocket==0)
{

	TempSocket=accept(Socket,NULL,NULL);
}

Socket=TempSocket;

printf(&quot;Client is connected&quot;);

	  system(&quot;PAUSE&quot;);

	  return 0;
}
</code></pre>
<pre><code class="language-cpp">#include&lt;WinSock.h&gt;
#include&lt;Windows.h&gt;
#include&lt;iostream&gt;

using namespace std;

int main()
{

	 printf(&quot;WINSOCK TUT\n\n\n&quot;);

     WSADATA WsaDat;

      if (WSAStartup(MAKEWORD(1, 1), &amp;WsaDat) != 0)

            {

             printf(&quot;WSA Initialization failed.&quot;);

            } 
	  else printf(&quot;WINSOCKET is Initializet successful\n\n&quot;);

	  SOCKET Socket;

	 Socket=socket(AF_INET,SOCK_STREAM,NULL);

	 if(Socket==INVALID_SOCKET) printf(&quot;SOCKET failed.&quot;);
	 else printf(&quot;Socket INIT successful\n\n&quot;);

sockaddr_in sockAddr;

sockAddr.sin_family = AF_INET;
sockAddr.sin_port =50;

sockAddr.sin_addr.S_un.S_addr = inet_addr(&quot;127.0.0.1&quot;);

connect(Socket,(SOCKADDR*)&amp;sockAddr,sizeof(sockAddr));

	  system(&quot;PAUSE&quot;);

	  return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/273446/winsocket-error</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 05:56:43 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/273446.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 07 Sep 2010 12:25:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Winsocket Error. on Tue, 07 Sep 2010 12:25:57 GMT]]></title><description><![CDATA[<p>Hab gester angefangen ein kleinens Netzwerk prog. zu basteln jedoch steh ich zu zeit an.<br />
Mein Ziel ist es eine Verbindung von meinen Laptop win[XP] zu meinen Stand-Pc windows 7 herzustellen.</p>
<p>Wenn ich das server und das client prog. auf meinen pc laufen lasse funktioniert es problemlos.<br />
Sobalt ich es jedoch über Lan probiere gibt mir accept() kein return!</p>
<p>Firewall ist bei beiden aus.</p>
<p>Server bzw. Client</p>
<pre><code class="language-cpp">#include&lt;WinSock.h&gt;
#include&lt;Windows.h&gt;
#include&lt;iostream&gt;

using namespace std;

int main()
{

	 printf(&quot;WINSOCK TUT\n\n\n&quot;);

     WSADATA WsaDat;

      if (WSAStartup(MAKEWORD(1, 1), &amp;WsaDat) != 0)

            {

             printf(&quot;WSA Initialization failed.&quot;);

            } 
	  else printf(&quot;WINSOCKET is Initializet successful\n\n&quot;);

	  SOCKET Socket;

	 Socket=socket(AF_INET,SOCK_STREAM,NULL);

	 if(Socket==INVALID_SOCKET) printf(&quot;SOCKET failed.&quot;);
	 else printf(&quot;Socket INIT successful\n\n&quot;);

sockaddr_in sockAddr;

sockAddr.sin_family = AF_INET;
sockAddr.sin_port =50;
sockAddr.sin_addr.S_un.S_addr= INADDR_ANY;

if(bind(Socket,(SOCKADDR*)&amp;sockAddr,sizeof(sockAddr))==SOCKET_ERROR) printf(&quot;Error Binding\n\n&quot;);
else printf(&quot;Binding sucessfull\n\n&quot;);

if(listen(Socket,1)==SOCKET_ERROR) printf(&quot;Error with Listing\n\n&quot;);
else printf(&quot;Socket is Listining\n\n&quot;);

printf(&quot;Server is weiting for Clients.......\n&quot;);
printf(&quot;Run Client Programm!!\n\n&quot;);

SOCKET TempSocket=0;

while(TempSocket==0)
{

	TempSocket=accept(Socket,NULL,NULL);
}

Socket=TempSocket;

printf(&quot;Client is connected&quot;);

	  system(&quot;PAUSE&quot;);

	  return 0;
}
</code></pre>
<pre><code class="language-cpp">#include&lt;WinSock.h&gt;
#include&lt;Windows.h&gt;
#include&lt;iostream&gt;

using namespace std;

int main()
{

	 printf(&quot;WINSOCK TUT\n\n\n&quot;);

     WSADATA WsaDat;

      if (WSAStartup(MAKEWORD(1, 1), &amp;WsaDat) != 0)

            {

             printf(&quot;WSA Initialization failed.&quot;);

            } 
	  else printf(&quot;WINSOCKET is Initializet successful\n\n&quot;);

	  SOCKET Socket;

	 Socket=socket(AF_INET,SOCK_STREAM,NULL);

	 if(Socket==INVALID_SOCKET) printf(&quot;SOCKET failed.&quot;);
	 else printf(&quot;Socket INIT successful\n\n&quot;);

sockaddr_in sockAddr;

sockAddr.sin_family = AF_INET;
sockAddr.sin_port =50;

sockAddr.sin_addr.S_un.S_addr = inet_addr(&quot;127.0.0.1&quot;);

connect(Socket,(SOCKADDR*)&amp;sockAddr,sizeof(sockAddr));

	  system(&quot;PAUSE&quot;);

	  return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1949245</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1949245</guid><dc:creator><![CDATA[zwingling]]></dc:creator><pubDate>Tue, 07 Sep 2010 12:25:57 GMT</pubDate></item><item><title><![CDATA[Reply to Winsocket Error. on Tue, 07 Sep 2010 13:25:39 GMT]]></title><description><![CDATA[<p>Statt &quot;127.0.0.1&quot; mußt du dann schon die IP des anderen Rechners eintragen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1949273</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1949273</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Tue, 07 Sep 2010 13:25:39 GMT</pubDate></item><item><title><![CDATA[Reply to Winsocket Error. on Tue, 07 Sep 2010 14:04:43 GMT]]></title><description><![CDATA[<p>lol Epic Fail!!!!! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>thx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1949295</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1949295</guid><dc:creator><![CDATA[zwingling]]></dc:creator><pubDate>Tue, 07 Sep 2010 14:04:43 GMT</pubDate></item></channel></rss>