MCPcopy Create free account
hub / github.com/SFML/SFML / main

Function main

examples/voip/VoIP.cpp:16–40  ·  view source on GitHub ↗

/////////////////////////////////////////////////////// Entry point of application \return Application exit code ///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

14///
15////////////////////////////////////////////////////////////
16int main()
17{
18 // Choose a random port for opening sockets (ports < 1024 are reserved)
19 const unsigned short port = 2435;
20
21 // Client or server ?
22 char who = 0;
23 std::cout << "Do you want to be a server ('s') or a client ('c')? ";
24 std::cin >> who;
25
26 if (who == 's')
27 {
28 // Run as a server
29 doServer(port);
30 }
31 else
32 {
33 // Run as a client
34 doClient(port);
35 }
36
37 // Wait until the user presses 'enter' key
38 std::cout << "Press enter to exit..." << std::endl;
39 std::cin.ignore(10'000, '\n');
40}

Callers

nothing calls this directly

Calls 2

doServerFunction · 0.85
doClientFunction · 0.85

Tested by

no test coverage detected