Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define SWRAP_STATIC
- #include "swrap.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- swrapInit();
- int socket = swrapSocket (SWRAP_UDP, SWRAP_CONNECT, SWRAP_NOBLOCK, "192.168.100.129", "1234");
- swrap_addr addr;
- swrapListen(socket, 0);
- while(true){
- int sock = swrapAccept(socket, &addr);
- if(sock != -1){
- cout << "connected" << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement