Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*** ETABLISSEMENT DE LA CONNEXION UDP **/
- info_on_destination.sin_family=AF_INET;
- info_on_destination.sin_addr.s_addr=inet_addr("192.168.241.187");
- info_on_destination.sin_port=htons(12345);
- /*** ENVOI DES DONNEES ***/
- strcpy(buffer, "J'envois les donnees à dodo !");
- nb_character = sendto(id_socket_send, buffer, sizeof(buffer),0,(struct sockaddr*)&info_on_destination,sizeof(info_on_destination));
- if(nb_character == SOCKET_ERROR) {
- cout << "Donnees nom envoyees du à l'erreur " << WSAGetLastError() << endl;
- return 0;
- }
- else {
- cout << "OK";
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement