-/* Copyright (c) 2013-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2013-2021. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
XBT_INFO("Server waiting for transfers ...");
while (true) {
- const std::string* msg = static_cast<std::string*>(mailbox->get());
+ auto msg = mailbox->get_unique<std::string>();
if (*msg == "finalize") { // Shutdown ...
- delete msg;
break;
} else { // Receive file to save
size_t pos = msg->find(' ');
std::string dest = msg->substr(0, pos);
sg_size_t size_to_write = std::stoull(msg->substr(pos + 1));
write_local_file(dest, size_to_write);
- delete msg;
}
}
e.run();
- XBT_INFO("Simulated time: %g", e.get_clock());
+ XBT_INFO("Simulated time: %g", simgrid::s4u::Engine::get_clock());
return 0;
}