mirror of
https://github.com/AntoineHX/LivingMachine.git
synced 2025-05-05 06:10:45 +02:00
Ajout de la bibli SFML (A)
This commit is contained in:
parent
73704e5139
commit
cca7498ca2
204 changed files with 26813 additions and 0 deletions
50
code/SFML-2.4.2/share/SFML/examples/voip/VoIP.cpp
Normal file
50
code/SFML-2.4.2/share/SFML/examples/voip/VoIP.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Function prototypes
|
||||
// (I'm too lazy to put them into separate headers...)
|
||||
////////////////////////////////////////////////////////////
|
||||
void doClient(unsigned short port);
|
||||
void doServer(unsigned short port);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Choose a random port for opening sockets (ports < 1024 are reserved)
|
||||
const unsigned short port = 2435;
|
||||
|
||||
// Client or server ?
|
||||
char who;
|
||||
std::cout << "Do you want to be a server ('s') or a client ('c')? ";
|
||||
std::cin >> who;
|
||||
|
||||
if (who == 's')
|
||||
{
|
||||
// Run as a server
|
||||
doServer(port);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Run as a client
|
||||
doClient(port);
|
||||
}
|
||||
|
||||
// Wait until the user presses 'enter' key
|
||||
std::cout << "Press enter to exit..." << std::endl;
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue