Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Checking server status - help  (Read 2927 times)

0 Members and 1 Guest are viewing this topic.

DanTheMan

  • Newbie
  • *
  • Posts: 2
    • View Profile
Checking server status - help
« on: January 12, 2012, 02:51:45 am »
Hi, my names Daniel im farely new to SFML however im steadily learning its features and i have come to appreciate the features it offers.

now my question is, using the sfml2 tutorial on sockets, [which works fine by the way] how can i let the client know if the server is not up.

e.g. the user presses login > it sends a connection request > if it fails show an image.

im think it has to do with the following;

Code: [Select]
   if (socket.Connect(server, port) != sf::Socket::Done)
        return;
    std::cout << "Connected to server " << server << std::endl;



but i've tried a few methods like enclosing the if statement to use else, but it didnt work.

any help would be greatly appreciated, thank you.[/code]