L
Hat jetzt iergendjemand ne Ahnung warum das hier nicht geht?
void main()
{
char cMsg[2000] = "";
bool lOk = false;
struct sockaddr_in GoogleServer;
WORD wVersionRequested;
WSADATA wsaData;
wVersionRequested = MAKEWORD( 1, 0 );
if ( WSAStartup( wVersionRequested, &wsaData ) == 0 )
{
// Make Socket
GoogleServer.sin_family = AF_INET;
GoogleServer.sin_port = htons( 80 );
GoogleServer.sin_addr.s_addr = inet_addr( "216.239.59.104" ); //wwp.google.de
int GoogleSock = socket( AF_INET, SOCK_STREAM, 0 );
// Connect Server
if ( connect( GoogleSock, (struct sockaddr *) &GoogleServer, sizeof( GoogleServer ) ) == 0 )
{
strcpy( cMsg, "GET /firefox?client=firefox-a&rls=org.mozilla:de:official HTTP/1.0\n\n" );
lOk = ( send( GoogleSock, cMsg, strlen( cMsg ), 0 ) >= 0 );
if ( lOk )
recv( GoogleSock, cMsg, 2000, 0 );
closesocket( GoogleSock );
}
// Close Winsock
WSACleanup();
}
system("pause");
}
output:
Drücken sie eine Taste um das Programm zu beenden...
:-$
Danke schonmal für eure Hilfe