Changed the naming convention for public member variables/functions and free functions (using lowerCase instead of UpperCase)

This commit is contained in:
Laurent Gomila 2012-03-11 19:10:37 +01:00
parent ff5b69d312
commit 14ac411542
200 changed files with 4302 additions and 4320 deletions

View file

@ -11,32 +11,32 @@
/// send a message and wait for the answer.
///
////////////////////////////////////////////////////////////
void RunTcpServer(unsigned short port)
void runTcpServer(unsigned short port)
{
// Create a server socket to accept new connections
sf::TcpListener listener;
// Listen to the given port for incoming connections
if (listener.Listen(port) != sf::Socket::Done)
if (listener.listen(port) != sf::Socket::Done)
return;
std::cout << "Server is listening to port " << port << ", waiting for connections... " << std::endl;
// Wait for a connection
sf::TcpSocket socket;
if (listener.Accept(socket) != sf::Socket::Done)
if (listener.accept(socket) != sf::Socket::Done)
return;
std::cout << "Client connected: " << socket.GetRemoteAddress() << std::endl;
std::cout << "Client connected: " << socket.getRemoteAddress() << std::endl;
// Send a message to the connected client
const char out[] = "Hi, I'm the server";
if (socket.Send(out, sizeof(out)) != sf::Socket::Done)
if (socket.send(out, sizeof(out)) != sf::Socket::Done)
return;
std::cout << "Message sent to the client: \"" << out << "\"" << std::endl;
// Receive a message back from the client
char in[128];
std::size_t received;
if (socket.Receive(in, sizeof(in), received) != sf::Socket::Done)
if (socket.receive(in, sizeof(in), received) != sf::Socket::Done)
return;
std::cout << "Answer received from the client: \"" << in << "\"" << std::endl;
}
@ -47,7 +47,7 @@ void RunTcpServer(unsigned short port)
/// welcome message and send an answer.
///
////////////////////////////////////////////////////////////
void RunTcpClient(unsigned short port)
void runTcpClient(unsigned short port)
{
// Ask for the server address
sf::IpAddress server;
@ -62,20 +62,20 @@ void RunTcpClient(unsigned short port)
sf::TcpSocket socket;
// Connect to the server
if (socket.Connect(server, port) != sf::Socket::Done)
if (socket.connect(server, port) != sf::Socket::Done)
return;
std::cout << "Connected to server " << server << std::endl;
// Receive a message from the server
char in[128];
std::size_t received;
if (socket.Receive(in, sizeof(in), received) != sf::Socket::Done)
if (socket.receive(in, sizeof(in), received) != sf::Socket::Done)
return;
std::cout << "Message received from the server: \"" << in << "\"" << std::endl;
// Send an answer to the server
const char out[] = "Hi, I'm a client";
if (socket.Send(out, sizeof(out)) != sf::Socket::Done)
if (socket.send(out, sizeof(out)) != sf::Socket::Done)
return;
std::cout << "Message sent to the server: \"" << out << "\"" << std::endl;
}