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
NatHoleTimeout seconds.
Functions ¶
This section is empty.
Types ¶
type ClientCfg ¶
type ClientCfg struct { Name string Sk string SidCh chan *SidRequest }
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(udpBindAddr string) (nc *Controller, err error)
func (*Controller) CloseClient ¶
func (nc *Controller) CloseClient(name string)
func (*Controller) GenNatHoleResponse ¶
func (nc *Controller) GenNatHoleResponse(session *Session, errInfo string) []byte
func (*Controller) GenSid ¶
func (nc *Controller) GenSid() string
func (*Controller) HandleClient ¶
func (nc *Controller) HandleClient(m *msg.NatHoleClient, raddr *net.UDPAddr)
func (*Controller) HandleVisitor ¶
func (nc *Controller) HandleVisitor(m *msg.NatHoleVisitor, raddr *net.UDPAddr)
func (*Controller) ListenClient ¶
func (nc *Controller) ListenClient(name string, sk string) (sidCh chan *SidRequest)
func (*Controller) Run ¶
func (nc *Controller) Run()
type SidRequest ¶
type SidRequest struct { Sid string NotifyCh chan struct{} }
Click to show internal directories.
Click to hide internal directories.