-void s4u::Actor::sendstr(Mailbox &chan, const char*msg) {
- char *msg_cpy=xbt_strdup(msg);
- smx_synchro_t comm = simcall_comm_isend(p_smx_process, chan.getInferior(), strlen(msg),
- -1/*rate*/, msg_cpy, sizeof(void *),
- NULL, NULL, NULL,NULL/*data*/, 0);
- simcall_comm_wait(comm, -1/*timeout*/);
+void s4u::Actor::send(Mailbox &chan, void *payload, size_t simulatedSize) {
+ Comm c = Comm::send_init(this,chan);
+ c.setRemains(simulatedSize);
+ c.setSrcData(payload);
+ // c.start() is optional.
+ c.wait();