Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main ( int argc, char** argv )
- {
- CNetwork Network;
- sf::Packet ToSend;
- sf::Packet Recieved;
- if (/* If you want to connect, you can add this anywhere */)
- {
- Network.Connect(sf::IPAddress(argv[1]));
- }
- while (/*main loop*/)
- {
- Network.WaitConnection();
- if ( Network.WaitData(&Recieved) )
- {
- // Do something with received data...
- }
- if (/*something to send*/)
- {
- // fill ToSend packet...
- if (!Network.SendData(&ToSend))
- {
- // failed to send...
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement