Further information:
I assumed from the above that removing the .close statement would leave the connection in tact, which it does. But I also assumed that in that state removing the power from the device at one end would break the connection and produce an error at the other.
Removing the power at the server end does, indeed, produce an error at the client end.
But, removing the power at the client end doesn't give any error at the server end, even after many minutes. Further on re-connecting the power at the client end, the client tries to connect and write and, apparently, succeeds but nothing happens at the server end.