code: func (c *Connection) wireWrite(d wiredata) {
  	f := &d.frame
  	// fmt.Printf("WWD01 f:[%v]\n", f)
  	switch f.Command {
  	case "\n": // HeartBeat frame
  		if c.dld.wde && c.dld.wds {
  			_ = c.netconn.SetWriteDeadline(time.Now().Add(c.dld.wdld))
  		}
  		_, e := c.wtr.WriteString(f.Command)
  		if e != nil {
  			if e.(net.Error).Timeout() {
  				if c.dld.dns {
  					c.dld.dlnotify(e, true)
  				}
  			}
  			d.errchan <- e
  			return
  		}
  	default: // Other frames
  		if e := f.writeFrame(c.wtr, c); e != nil {
  			d.errchan <- e
  			return
  		}
  		if e := c.wtr.Flush(); e != nil {
  			d.errchan <- e
  			return
  		}
  	}
  	if e := c.wtr.Flush(); e != nil {
  		d.errchan <- e
  		return
  	}
  	//
  	if c.hbd != nil {
  		c.hbd.sdl.Lock()
  		c.hbd.ls = time.Now().UnixNano() // Latest good send
  		c.hbd.sdl.Unlock()
  	}
  	c.mets.tfw++                // Frame written count
  	c.mets.tbw += f.Size(false) // Bytes written count
  	//
  	d.errchan <- nil
  	return
  }
docs: /*
  	Connection logical write.
  */