Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 "
GeneralRe: my programm is not accepting connections Pin
willempipi3-Feb-03 0:24
willempipi3-Feb-03 0:24 
GeneralRe: my programm is not accepting connections Pin
SatyaDY3-Feb-03 0:31
SatyaDY3-Feb-03 0:31 
Generalaccess class members from a non class global static function Pin
Anonymous3-Feb-03 0:06
Anonymous3-Feb-03 0:06 
GeneralRe: access class members from a non class global static function Pin
xxhimanshu3-Feb-03 0:31
xxhimanshu3-Feb-03 0:31 
GeneralRe: access class members from a non class global static function Pin
Abbas_Riazi3-Feb-03 5:29
professionalAbbas_Riazi3-Feb-03 5:29 
Generaliphlpapi and CPing Pin
naradaji2-Feb-03 23:32
naradaji2-Feb-03 23:32 
GeneralRe: iphlpapi and CPing Pin
Abbas_Riazi3-Feb-03 5:33
professionalAbbas_Riazi3-Feb-03 5:33 
GeneralRe: iphlpapi and CPing Pin
naradaji3-Feb-03 23:36
naradaji3-Feb-03 23:36 
GeneralRe: iphlpapi and CPing Pin
Abbas_Riazi4-Feb-03 6:31
professionalAbbas_Riazi4-Feb-03 6:31 
GeneralRe: iphlpapi and CPing Pin
Anonymous4-Feb-03 22:10
Anonymous4-Feb-03 22:10 
GeneralRe: iphlpapi and CPing Pin
Abbas_Riazi5-Feb-03 1:06
professionalAbbas_Riazi5-Feb-03 1:06 
GeneralRe: iphlpapi and CPing Pin
Anonymous5-Feb-03 22:54
Anonymous5-Feb-03 22:54 
GeneralExit with confirmation Pin
José Luis Sogorb2-Feb-03 23:30
José Luis Sogorb2-Feb-03 23:30 
GeneralRe: Exit with confirmation Pin
Christian Graus2-Feb-03 23:58
protectorChristian Graus2-Feb-03 23:58 
GeneralRe: Exit with confirmation Pin
Moak3-Feb-03 0:51
Moak3-Feb-03 0:51 
GeneralRe: Exit with confirmation Pin
Christian Graus3-Feb-03 1:31
protectorChristian Graus3-Feb-03 1:31 
GeneralRe: Exit with confirmation Pin
José Luis Sogorb3-Feb-03 5:58
José Luis Sogorb3-Feb-03 5:58 

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.