title: When a socket is disconnected in Go, can I know if it was a good or bad close?
body: <p>Say I open a connection to a server like:</p>
  
  <pre><code>conn, _ := net.DialTimeout("tcp", "127.0.0.1:2121", 10000000)
  </code></pre>
  
  <p>and I do some stuff and then call</p>
  
  <pre><code>conn.Close()
  </code></pre>
  
  <p>that's option 1. But what if I don't call Close on the conn and just call</p>
  
  <pre><code>os.Exit(1)
  </code></pre>
  
  <p>leaving the connection still open. That's option 2. i.e. I'm trying to simulate a user uploading a file and either reaching the ending and really Closing the connection... or ending the stream being writen to the socket but never officially closing it.</p>
  
  <p>Back on the server side, is there anyway to tell which event happened? The good Close or the bad one?</p>
  
  <p>Does <code>net.Listener</code> have like some sort of callback to let me know. Because when I just call:</p>
  
  <pre><code>n, err := serverConn.Read()
  </code></pre>
  
  <p>I get an EOF err in either case, good or bad.</p>