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(); }
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; } } }
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(); } }