func (p *Peer) Close() error {
	p.connLock.Lock()
	defer p.connLock.Unlock()
	var err error
	if p.connCurrent != nil {
		err = p.connCurrent.Close()
		p.connCurrent = nil
	}
	p.connBad = false
	return err
}
// Close closes the peer and the connection is connected.
Close closes the peer and the connection is connected.
// Close closes the peer and the connection is connected .
func (p *Peer) Close() error {
	p.connLock.Lock()
	defer p.connLock.Unlock()
	var err error
	if p.connCurrent != nil {
		err = p.connCurrent.Close()
		p.connCurrent = nil
	}
	p.connBad = false
	return err
}
func ( p * Peer ) Close ( ) error { p . connLock . Lock ( ) defer p . connLock . Unlock ( ) var err error if p . connCurrent != nil { err = p . connCurrent . Close ( ) p . connCurrent = nil } p . connBad = false return err }
Close closes the peer and the connection is connected.
Close closes the peer and the connection is connected .