p2p

package
v0.0.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDialIpPort added in v0.0.14

func GetDialIpPort(token *models.TokenClaims) (localAddr, externalAddr *net.UDPAddr, err error)

获取一个随机UDP Dial的内部ip,端口,外部ip端口

func GetNewListener added in v0.0.16

func GetNewListener(oldListener *net.UDPConn) (newListener *net.UDPConn, err error)

把旧的Listener关闭创建一个新的Listener返回,本地地址相同

func GetP2PListener

func GetP2PListener(token *models.TokenClaims) (externalUDPAddr *net.UDPAddr, listener *net.UDPConn, err error)

获取一个随机UDP Listen的内部ip,端口,外部ip端口

func SendPackToPeerByRemoteNetInfo added in v0.0.13

func SendPackToPeerByRemoteNetInfo(listener *net.UDPConn, ctrlmMsg *models.RemoteNetInfo)

client通过指定listener发送数据到explorer指定的p2p请求地址

func SendPackToPeerByReqNewP2PCtrlAsClient added in v0.0.6

func SendPackToPeerByReqNewP2PCtrlAsClient(listener *net.UDPConn, ctrlmMsg *models.ReqNewP2PCtrlAsClient)

client通过指定listener发送数据到explorer指定的p2p请求地址

func SendPackToPeerByReqNewP2PCtrlAsServer added in v0.0.6

func SendPackToPeerByReqNewP2PCtrlAsServer(listener *net.UDPConn, ctrlmMsg *models.ReqNewP2PCtrlAsServer)

client通过指定listener发送数据到explorer指定的p2p请求地址

func SendPackToPeerByUDPAddr added in v0.0.13

func SendPackToPeerByUDPAddr(listener *net.UDPConn, raddr *net.UDPAddr)

client通过指定listener发送数据到explorer指定的p2p请求地址

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL