code: func (c *Connection) writer() {
  writerLoop:
  	for {
  		select {
  		case d := <-c.output:
  			c.log("WTR_WIREWRITE start")
  			c.wireWrite(d)
  			logLock.Lock()
  			if c.logger != nil {
  				c.logx("WTR_WIREWRITE COMPLETE", d.frame.Command, d.frame.Headers,
  					HexData(d.frame.Body))
  			}
  			logLock.Unlock()
  			if d.frame.Command == DISCONNECT {
  				break writerLoop // we are done with this connection
  			}
  		case _ = <-c.ssdc:
  			c.log("WTR_WIREWRITE shutdown S received")
  			break writerLoop
  		case _ = <-c.wtrsdc:
  			c.log("WTR_WIREWRITE shutdown W received")
  			break writerLoop
  		}
  	} // of for
  	//
  	c.connLock.Lock()
  	c.connected = false
  	c.connLock.Unlock()
  	c.sysAbort()
  	c.log("WTR_SHUTDOWN", time.Now())
  }
docs: /*
  	Logical network writer.  Read wiredata structures from the communication
  	channel, and put the frame on the wire.
  */