Uthernet II: do not attempt to restore a UDP / TCP socket.
Mark it as closed and let the running program abort... Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
510c2fcddd
commit
c1c0400be4
1 changed files with 8 additions and 0 deletions
|
@ -263,6 +263,14 @@ bool Socket::LoadSnapshot(YamlLoadHelper &yamlLoadHelper)
|
|||
sn_rx_wr = yamlLoadHelper.LoadUint(SS_YAML_KEY_SOCKET_RX_WRITE_REGISTER);
|
||||
sn_rx_rsr = yamlLoadHelper.LoadUint(SS_YAML_KEY_SOCKET_RX_SIZE_REGISTER);
|
||||
sn_sr = yamlLoadHelper.LoadUint(SS_YAML_KEY_SOCKET_REGISTER);
|
||||
|
||||
if (sn_sr != W5100_SN_SR_SOCK_MACRAW)
|
||||
{
|
||||
// no point in restoring a broken UDP or TCP connection
|
||||
// just reset the socket
|
||||
sn_sr = W5100_SN_SR_CLOSED;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue