title image


Smiley simples Netz-Programm (source inside): Kompilerfehler --- help !? SE
hallo!was ist daran falsch:#include #include #ifdef _WIN32 #include #include #else #include #include #include #include #define closesocket(s) close(s)#endif #define HTTP_PORT 80#define SERVER_ID "127.0.0.1"#define LOGIN_URL "/login.php?user="int main(int argc, char **argv){ struct sockaddr_in server; struct hostent *host_info; int sock; char buffer[8192]; int count; #ifdef _WIN32 short wVersionRequested; WSADATA wsaData; wVersionRequested = MAKEWORD (1, 1); if(WSAStartup(wVersionRequested, &wsaData) != 0) exit(1); #endif if(argc != 2) exit(1); sock = socket( PF_INET, SOCK_STREAM, 0); if(sock exit(1); host_info = gethostbyname(SERVER_ID); if(NULL == host_info) exit(1); memset(&server, 0, sizeof(server)); server.sin_family = host_info->h_addrtype; memcpy((char *)&server.sin_addr, host_info->h_addr, host_info->h_length); server.sin_port = htons(HTTP_PORT); if(connect(sock, (struct sockaddr*)&server, sizeof(server)) exit(1); sprintf(buffer, "GET %s%s HTTP/1.0\n\n", LOGIN_URL, argv[1]); send(sock, buffer, strlen(buffer), 0);// do {// count = recv(sock, buffer, sizeof(buffer), 0);// write(1, buffer, count);// }// while (count > 0); closesocket(sock); return count;}DankeTT

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: