Advertisement
Guest User

dodo

a guest
Nov 12th, 2019
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. /*** ETABLISSEMENT DE LA CONNEXION UDP **/
  2. info_on_destination.sin_family=AF_INET;
  3. info_on_destination.sin_addr.s_addr=inet_addr("192.168.241.187");
  4. info_on_destination.sin_port=htons(12345);
  5.  
  6.  
  7. /*** ENVOI DES DONNEES ***/
  8. strcpy(buffer, "J'envois les donnees à dodo !");
  9. nb_character = sendto(id_socket_send, buffer, sizeof(buffer),0,(struct sockaddr*)&info_on_destination,sizeof(info_on_destination));
  10.  
  11. if(nb_character == SOCKET_ERROR) {
  12. cout << "Donnees nom envoyees du à l'erreur " << WSAGetLastError() << endl;
  13. return 0;
  14. }
  15. else {
  16. cout << "OK";
  17. return 1;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement