Example #1
0
func (p *Pumper) init(rw MsgReadWriter, h PumperHandler, inN, outN int) {
	p.stopD = syncx.NewDoneChan()

	p.rw = rw
	p.h = h

	p.rD = syncx.NewDoneChan()
	p.rQ = make(chan msgEntry, inN)
	p.wD = syncx.NewDoneChan()
	p.wQ = make(chan msgEntry, outN)
}
Example #2
0
// NewServer allocates and returns a new Server.
//
// Note: hsto is "handshake timeout".
func NewServerF(l net.Listener, ioc Converter, hsto time.Duration,
	h PumperHandler, pumperInN, pumperOutN int) *Server {

	s := &Server{
		stopD:      syncx.NewDoneChan(),
		l:          l,
		ioc:        ioc,
		hsto:       hsto,
		h:          h,
		pumperInN:  pumperInN,
		pumperOutN: pumperOutN,
	}

	return s
}