Пример #1
0
bool SendMailSms::SendEmail(const char* from, const char* to, const char* subject, const char* body) {
  PrepareConnection(sendEmailPath);
  AddParam("from", from);
  AddParam("sender", from);
  AddParam("replyTo", from);
  AddParam("subject", subject);
  AddParam("to", to);
  AddParam("bodyText", body);
  return FinalizeConnection();
}
Пример #2
0
void TServerComms::Update(nel::TGameTime deltaTime)
{
	std::lock_guard<std::mutex> g(ClientSocketsMutex);

	for (auto it = ClientSockets.begin(); it != ClientSockets.end(); it++)
	{
		TClientSocket* client = *it;
		if (client->getRemoteAddress() == sf::IpAddress::None)
		{
			// UNTESTED!
			FinalizeConnection(client);
			ClientSockets.remove(client);
			delete client;
		}
	}
}
Пример #3
0
void TServerComms::Stop()
{
	ThreadsShouldStop = true;
	if (ListenerThread)
	{
		ListenerThread->join();
		delete ListenerThread;
		ListenerThread = nullptr;
	}

	SocketSelector.clear();
	Listener.close();

	{
		std::lock_guard<std::mutex> g(ClientSocketsMutex);
		for (auto it = ClientSockets.begin(); it != ClientSockets.end(); it++)
		{
			TClientSocket* client = *it;
			FinalizeConnection(client);
			delete client;
		}
		ClientSockets.clear();
	}
}