MCPcopy Create free account
hub / github.com/apple/foundationdb / send

Method send

fdbrpc/sim2.actor.cpp:2351–2362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2349 }
2350
2351 ACTOR static Future<Void> send(UDPSimSocket* self,
2352 Reference<UDPSimSocket> peerSocket,
2353 uint8_t const* begin,
2354 uint8_t const* end) {
2355 state Packet packet(std::make_shared<std::vector<uint8_t>>());
2356 packet->resize(end - begin);
2357 std::copy(begin, end, packet->begin());
2358 wait(delay(.002 * deterministicRandom()->random01()));
2359 peerSocket->recvBuffer.emplace_back(self->_localAddress, std::move(packet));
2360 peerSocket->writtenPackets.set(peerSocket->writtenPackets.get() + 1);
2361 return Void();
2362 }
2363
2364 ACTOR static Future<int> receiveFrom(UDPSimSocket* self, uint8_t* begin, uint8_t* end, NetworkAddress* sender) {
2365 state TaskPriority currentTaskID = g_sim2.getCurrentTask();

Callers 4

incomingMethod · 0.45
execTaskFunction · 0.45
~UDPSimSocketMethod · 0.45
doRebootFunction · 0.45

Calls 15

copyFunction · 0.85
delayFunction · 0.85
deterministicRandomFunction · 0.85
moveFunction · 0.85
random01Method · 0.80
emplace_backMethod · 0.80
VoidClass · 0.70
setMethod · 0.65
getMethod · 0.65
resizeMethod · 0.45
beginMethod · 0.45
presentMethod · 0.45

Tested by

no test coverage detected