<?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[Server &#x2F; Client Programmierung Frage]]></title><description><![CDATA[<p>Eine Frage zum Server , hier mein bisheriger Code :</p>
<pre><code class="language-cpp">int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	rc=startWinsock();
	if(rc!=0)   
		return 1;
	acceptSocket=socket(AF_INET,SOCK_STREAM,0);
	if(acceptSocket==INVALID_SOCKET)
		return 1;
	memset(&amp;addr,0,sizeof(SOCKADDR_IN));

	addr.sin_family=AF_INET;
	addr.sin_port=htons(12345);
	addr.sin_addr.s_addr=ADDR_ANY;

	rc=bind(acceptSocket,(SOCKADDR*)&amp;addr,sizeof(SOCKADDR_IN));

	if(rc==SOCKET_ERROR)  
		return 1;

	rc=listen(acceptSocket,10);
	if(rc==SOCKET_ERROR)  
		return 1;

	connectedSocket=accept(acceptSocket,NULL,NULL);
	if(connectedSocket==INVALID_SOCKET)   
		return 1;

	while(rc!=SOCKET_ERROR)
	{	
		rc=recv(connectedSocket,buf,sizeof(buf),0);

		if(rc==0 || rc==SOCKET_ERROR)     
			break;

		buf[rc]='\0';
	}	
  closesocket(acceptSocket);
  closesocket(connectedSocket);
  WSACleanup();
  return 0;
}
</code></pre>
<p>Jetzt moechte ich 2 Sachen :</p>
<p>(1) Mehrere Clients auf einmal koennen zum Server connecten<br />
(2) Wenn der Client disconnected soll die Server-Datei nicht beenden sondern von vorne anfangen</p>
<p>Wie bekomme ich das hin ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/156947/server-client-programmierung-frage</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 23:45:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/156947.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Aug 2006 18:10:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Server &#x2F; Client Programmierung Frage on Mon, 21 Aug 2006 18:10:32 GMT]]></title><description><![CDATA[<p>Eine Frage zum Server , hier mein bisheriger Code :</p>
<pre><code class="language-cpp">int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	rc=startWinsock();
	if(rc!=0)   
		return 1;
	acceptSocket=socket(AF_INET,SOCK_STREAM,0);
	if(acceptSocket==INVALID_SOCKET)
		return 1;
	memset(&amp;addr,0,sizeof(SOCKADDR_IN));

	addr.sin_family=AF_INET;
	addr.sin_port=htons(12345);
	addr.sin_addr.s_addr=ADDR_ANY;

	rc=bind(acceptSocket,(SOCKADDR*)&amp;addr,sizeof(SOCKADDR_IN));

	if(rc==SOCKET_ERROR)  
		return 1;

	rc=listen(acceptSocket,10);
	if(rc==SOCKET_ERROR)  
		return 1;

	connectedSocket=accept(acceptSocket,NULL,NULL);
	if(connectedSocket==INVALID_SOCKET)   
		return 1;

	while(rc!=SOCKET_ERROR)
	{	
		rc=recv(connectedSocket,buf,sizeof(buf),0);

		if(rc==0 || rc==SOCKET_ERROR)     
			break;

		buf[rc]='\0';
	}	
  closesocket(acceptSocket);
  closesocket(connectedSocket);
  WSACleanup();
  return 0;
}
</code></pre>
<p>Jetzt moechte ich 2 Sachen :</p>
<p>(1) Mehrere Clients auf einmal koennen zum Server connecten<br />
(2) Wenn der Client disconnected soll die Server-Datei nicht beenden sondern von vorne anfangen</p>
<p>Wie bekomme ich das hin ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1121751</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1121751</guid><dc:creator><![CDATA[PhoeNix_FasT]]></dc:creator><pubDate>Mon, 21 Aug 2006 18:10:32 GMT</pubDate></item><item><title><![CDATA[Reply to Server &#x2F; Client Programmierung Frage on Mon, 21 Aug 2006 22:20:50 GMT]]></title><description><![CDATA[<p>Schau mal hier: <a href="http://c-worker.ch/tuts/select.html" rel="nofollow">http://c-worker.ch/tuts/select.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1121885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1121885</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 21 Aug 2006 22:20:50 GMT</pubDate></item><item><title><![CDATA[Reply to Server &#x2F; Client Programmierung Frage on Tue, 22 Aug 2006 06:18:55 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>hier ist ein guter Link wo sowas erstellt wurde:<br />
<a href="http://www.pronix.de/pronix-637.html" rel="nofollow">http://www.pronix.de/pronix-637.html</a></p>
<p>MfG, Heimdall83</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1121927</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1121927</guid><dc:creator><![CDATA[Heimdall83]]></dc:creator><pubDate>Tue, 22 Aug 2006 06:18:55 GMT</pubDate></item><item><title><![CDATA[Reply to Server &#x2F; Client Programmierung Frage on Tue, 22 Aug 2006 22:21:53 GMT]]></title><description><![CDATA[<p>Mit einem &quot;return&quot; beendest du dein Programm. Wenn du willst, dass es neu gestartet wird, dann musste das rausmachen und alles in eine while(1)-Schleife. Für mehrere Clients würde ich auch die select-Methode verwenden. Das Tutorial auf der von CodeFInder geposteten Page ist Klasse.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1122476</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1122476</guid><dc:creator><![CDATA[DerMoe]]></dc:creator><pubDate>Tue, 22 Aug 2006 22:21:53 GMT</pubDate></item></channel></rss>