Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <SDL2/SDL_net.h>
- using namespace std;
- int main()
- {
- if( SDL_Init(SDL_INIT_EVERYTHING) != 0 )
- {
- cout << "Failed to initialize SDL: " << SDL_GetError() << endl;
- exit(-1);
- }
- atexit(SDL_Quit);
- if( SDLNet_Init() != 0 )
- {
- cout << "Failed to initialize SDL Net: " << SDLNet_GetError() << endl;
- exit(-1);
- }
- atexit(SDLNet_Quit);
- IPaddress ip;
- SDLNet_ResolveHost(&ip, "0.0.0.0", 12000);
- TCPsocket socket = SDLNet_TCP_Open(&ip);
- if( socket == NULL )
- cout << SDLNet_GetError() << endl;
- cout << SDLNet_ResolveIP(&ip) << endl;
- SDLNet_TCP_Close(socket);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement