MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / LoadSnapshot

Method LoadSnapshot

source/Uthernet2.cpp:337–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337bool Socket::LoadSnapshot(YamlLoadHelper &yamlLoadHelper)
338{
339 clearFD();
340
341 sn_rx_wr = yamlLoadHelper.LoadUint(SS_YAML_KEY_SOCKET_RX_WRITE_REGISTER);
342 sn_rx_rsr = yamlLoadHelper.LoadUint(SS_YAML_KEY_SOCKET_RX_SIZE_REGISTER);
343 uint8_t socketStatus = yamlLoadHelper.LoadUint(SS_YAML_KEY_SOCKET_REGISTER);
344
345 // transmit and receive sizes are restored from the card common registers
346 switch (socketStatus)
347 {
348 case W5100_SN_SR_SOCK_MACRAW:
349 case W5100_SN_SR_SOCK_IPRAW:
350 // we can restore RAW sockets
351 break;
352 default:
353 // no point in restoring a broken UDP or TCP connection
354 // just reset the socket
355 socketStatus = W5100_SN_SR_CLOSED;
356 // for the same reason there is no point in saving myFD
357 break;
358 }
359
360 setStatus(socketStatus);
361
362 return true;
363}
364
365const std::string& Uthernet2::GetSnapshotCardName()
366{

Callers

nothing calls this directly

Calls 7

StrFormatFunction · 0.85
LoadUintMethod · 0.80
LoadStringMethod · 0.80
LoadBoolMethod · 0.80
LoadMemoryMethod · 0.80
PopMapMethod · 0.80
GetSubMapMethod · 0.45

Tested by

no test coverage detected