func (conn *Pipe) Send(pkt interface{}) error {
	select {
	case conn.pipe <- pkt:
		return nil
	case <-conn.close:
		return errors.New("closed")
	}
}
Send returns packet on next Receive call.
package mock
import (
	"errors"
	"fmt"
	"io"
	"strings"
	"time"
)
type Conn interface {
	Send(pkt interface{}) error
	Receive() (interface{}, error)
	Close() error
}
type Pipe struct {
	pipe  chan interface{}
	close chan struct{}
}
func NewPipe() *Pipe {
	return &Pipe{
		pipe:  make(chan interface{}),
		close: make(chan struct{}),
	}
}