title: TCP server not recognizing switched off IOT device
body: <p>I've built a server that is connected to multiple IOT devices. They communicate solely over TCP and use a vendor-specific protocol.</p>
  <p>My server is listening to the TCP connection and whenever I receive an <code>EOF</code> I close the connection and clean everything up.</p>
  <p>This works fine when I use a tool like &quot;Packet Sender&quot;. As soon as I click the &quot;Close&quot; button my server recognizes that the client closed the connection and then does the clean up.</p>
  <p>The problem occurs when I use the real machines that are connected over the telephone network (SIM cards). When I switch them off - literally nothing happens in my server. Even worse: I can still <strong>write</strong> to those devices without any problems (except the device is offline)!</p>
  <p>From my perspective we should at least know that the connection is closed by the client if we try to write to it?</p>
  <p>Why is there such a difference in the behavior between my tool &quot;Packet Sender&quot; and the real machines?</p>
  <p>Also: how can I solve the problem of getting informed right away when a machine is turned off?</p>
  <p>Thanks in advance.</p>