SHARE
TWEET

Untitled

a guest Jan 22nd, 2020 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define SWRAP_STATIC
  2. #include "swrap.h"
  3. #include <iostream>
  4.  
  5. using namespace std;
  6. int main()
  7. {
  8.     swrapInit();
  9.     int socket = swrapSocket (SWRAP_UDP, SWRAP_CONNECT, SWRAP_NOBLOCK, "192.168.100.129", "1234");
  10.     swrap_addr addr;
  11.     swrapListen(socket, 0);
  12.     while(true){
  13.        
  14.         int sock = swrapAccept(socket, &addr);
  15.         if(sock != -1){
  16.            
  17.             cout << "connected" << endl;
  18.            
  19.         }
  20.        
  21.     }
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top