Example #1
0
func NewFrontend(listener link.IPacketListener, handshaker ClientHandshaker) *Frontend {
	front := &Frontend{
		server:     link.NewServer(listener, link.Bytes()),
		links:      make(map[uint64]*frontendLink),
		handshaker: handshaker,
	}
	go front.loop()
	return front
}
Example #2
0
func NewFrontend(listener *packet.Listener, handshaker ClientHandshaker) *Frontend {
	front := &Frontend{
		server:     link.NewServer(listener),
		links:      make(map[uint64]*frontendLink),
		handshaker: handshaker,
	}
	go front.serveClient()
	return front
}
Example #3
0
func (backend *Backend) NewListener(listener net.Listener) (link.Listener, error) {
	lsn, _ := backend.StreamProtocol.NewListener(listener)
	srv := link.NewServer(lsn, link.SelfCodec())
	return NewBackendListener(srv), nil
}
Example #4
0
func (backend *Backend) NewListener(listener net.Listener) link.Listener {
	return NewBackendListener(link.NewServer(backend.protocol.NewListener(listener)))
}