Click here to Skip to main content
15,912,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: precompiled header directive and end of file Pin
ns3-Feb-03 4:14
ns3-Feb-03 4:14 
GeneralRe: precompiled header directive and end of file Pin
Abbas_Riazi3-Feb-03 4:54
professionalAbbas_Riazi3-Feb-03 4:54 
GeneralRe: precompiled header directive and end of file Pin
Michael Dunn3-Feb-03 7:01
sitebuilderMichael Dunn3-Feb-03 7:01 
GeneralRe: precompiled header directive and end of file Pin
ns3-Feb-03 7:43
ns3-Feb-03 7:43 
GeneralCToolBarCtrl Pin
satyavasu3-Feb-03 1:04
satyavasu3-Feb-03 1:04 
GeneralRe: CToolBarCtrl Pin
Abbas_Riazi3-Feb-03 4:58
professionalAbbas_Riazi3-Feb-03 4:58 
GeneralCToolBarCtrl Pin
satyavasu3-Feb-03 1:04
satyavasu3-Feb-03 1:04 
GeneralApplication name Pin
vin3-Feb-03 0:42
vin3-Feb-03 0:42 
GeneralRe: Application name Pin
Mike Nordell3-Feb-03 0:47
Mike Nordell3-Feb-03 0:47 
GeneralRe: Application name Pin
vin3-Feb-03 0:54
vin3-Feb-03 0:54 
GeneralRe: Application name Pin
Rage3-Feb-03 1:44
professionalRage3-Feb-03 1:44 
GeneralRe: Application name Pin
vin3-Feb-03 23:21
vin3-Feb-03 23:21 
GeneralRe: Application name Pin
Abbas_Riazi3-Feb-03 4:59
professionalAbbas_Riazi3-Feb-03 4:59 
GeneralOLE Container . Pin
vijayaramaraju3-Feb-03 0:41
vijayaramaraju3-Feb-03 0:41 
GeneralIActiveScript::AddTypeLib Pin
AlexO3-Feb-03 4:03
AlexO3-Feb-03 4:03 
Generalaccess class members from a non class global static function Pin
SPGV3-Feb-03 0:27
SPGV3-Feb-03 0:27 
GeneralRe: access class members from a non class global static function Pin
xxhimanshu3-Feb-03 0:33
xxhimanshu3-Feb-03 0:33 
GeneralRe: access class members from a non class global static function Pin
SPGV3-Feb-03 1:01
SPGV3-Feb-03 1:01 
GeneralRe: access class members from a non class global static function Pin
xxhimanshu3-Feb-03 1:19
xxhimanshu3-Feb-03 1:19 
GeneralRe: access class members from a non class global static function Pin
SPGV3-Feb-03 1:34
SPGV3-Feb-03 1:34 
GeneralRe: access class members from a non class global static function Pin
Rage3-Feb-03 1:51
professionalRage3-Feb-03 1:51 
GeneralRe: access class members from a non class global static function Pin
xxhimanshu3-Feb-03 1:57
xxhimanshu3-Feb-03 1:57 
GeneralRe: access class members from a non class global static function Pin
SPGV3-Feb-03 2:11
SPGV3-Feb-03 2:11 
GeneralRe: access class members from a non class global static function Pin
Rage3-Feb-03 2:46
professionalRage3-Feb-03 2:46 
Generalmy programm is not accepting connections Pin
willempipi3-Feb-03 0:07
willempipi3-Feb-03 0:07 
the socket has been bind but my server is still not listning to my port, it just gives a INVALID_SOCKET.

<small>UINT ServerThread(LPVOID Param)<br />
{<br />
	SOCKET server;<br />
	WSADATA wsaData;<br />
	sockaddr_in local;<br />
	ServerStart = TRUE;<br />
<br />
	int wsaret = WSAStartup(0x101, &wsaData);<br />
<br />
	if (wsaret != 0)<br />
	{<br />
		return 0;<br />
	}<br />
	<br />
	local.sin_family = AF_INET;<br />
	local.sin_addr.s_addr = INADDR_ANY;<br />
	local.sin_port = htons((u_short)20248);<br />
	server=socket(AF_INET,SOCK_STREAM,0);<br />
<br />
	if(server==INVALID_SOCKET)<br />
	{<br />
		AfxMessageBox("server invalid socket");<br />
		return 0;<br />
	}<br />
<br />
	if (bind(server, (sockaddr*)&local, sizeof(local)) == SOCKET_ERROR)<br />
	{<br />
		AfxMessageBox("Binden van socket mislukt");	<br />
		return 0;<br />
	}<br />
	<br />
	SOCKET client;<br />
	sockaddr_in from;<br />
	int fromlen = sizeof(from);<br />
	<br />
	AfxMessageBox("Server gestart");<br />
<br />
	char temp[512];<br />
<br />
	while(ServerStart == TRUE)<br />
	{<br />
		client = accept(server, (struct sockaddr*)&from, &fromlen);<br />
		if (client != INVALID_SOCKET)<br />
		{<br />
			AfxMessageBox("accept");<br />
			sprintf(temp, "Your IP is %s\r\n", inet_ntoa(from.sin_addr));<br />
<br />
			send(client, temp, strlen(temp), 0);<br />
			closesocket(client);<br />
		}<br />
else<br />
{<br />
AfxMessageBox("invalid socket");<br />
}<br />
	}<br />
<br />
	AfxMessageBox("Server Afgesloten");<br />
<br />
	closesocket(server);<br />
<br />
	WSACleanup();<br />
<br />
	return 0;<br />
}</small>


what am i doing wrong? the programm keep giving the message: " invalid socket "

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.