Documentation ¶
Index ¶
- Variables
- type ClientCfg
- type Controller
- func (nc *Controller) CloseClient(name string)
- func (nc *Controller) GenNatHoleResponse(session *Session, errInfo string) []byte
- func (nc *Controller) GenSid() string
- func (nc *Controller) HandleClient(m *msg.NatHoleClient, raddr *net.UDPAddr)
- func (nc *Controller) HandleVisitor(m *msg.NatHoleVisitor, raddr *net.UDPAddr)
- func (nc *Controller) ListenClient(name string, sk string) (sidCh chan *SidRequest)
- func (nc *Controller) Run()
- type Session
- type SidRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var NatHoleTimeout int64 = 10
Timeout seconds.
Functions ¶
This section is empty.
Types ¶
type ClientCfg ¶ added in v0.34.0
type ClientCfg struct { Name string Sk string SidCh chan *SidRequest }
type Controller ¶ added in v0.34.0
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶ added in v0.34.0
func NewController(udpBindAddr string) (nc *Controller, err error)
func (*Controller) CloseClient ¶ added in v0.34.0
func (nc *Controller) CloseClient(name string)
func (*Controller) GenNatHoleResponse ¶ added in v0.34.0
func (nc *Controller) GenNatHoleResponse(session *Session, errInfo string) []byte
func (*Controller) GenSid ¶ added in v0.34.0
func (nc *Controller) GenSid() string
func (*Controller) HandleClient ¶ added in v0.34.0
func (nc *Controller) HandleClient(m *msg.NatHoleClient, raddr *net.UDPAddr)
func (*Controller) HandleVisitor ¶ added in v0.34.0
func (nc *Controller) HandleVisitor(m *msg.NatHoleVisitor, raddr *net.UDPAddr)
func (*Controller) ListenClient ¶ added in v0.34.0
func (nc *Controller) ListenClient(name string, sk string) (sidCh chan *SidRequest)
func (*Controller) Run ¶ added in v0.34.0
func (nc *Controller) Run()
type SidRequest ¶ added in v0.25.0
type SidRequest struct { Sid string NotifyCh chan struct{} }
Click to show internal directories.
Click to hide internal directories.