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 }
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 }
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 }
func (backend *Backend) NewListener(listener net.Listener) link.Listener { return NewBackendListener(link.NewServer(backend.protocol.NewListener(listener))) }