Documentation
¶
Index ¶
- type Client
- func (cli *Client) CloseChannel(channelId int) bool
- func (cli *Client) Connect(channelCount int, networkType string, onDisconnect network.SocketCallbackFunc) error
- func (cli *Client) ConnectByIce(conn net.PacketConn, dummyAddr net.Addr) error
- func (cli *Client) ConnectToNet(channelCount int, conn net.PacketConn, addr net.Addr, ...) error
- func (cli *Client) OnClosed() error
- func (cli *Client) OnClosing() bool
- func (cli *Client) Send(channelId int, data []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Id string
SessionId string
//需要连接的服务端地址
ServerAddress string
NetConn net.PacketConn
QuicConn *quic.Conn
Socket *network.Socket
StreamConfigs []network.StreamConfig
network.Config
ice.IceWorker
framework.CloseableObject
OnSocketConnected network.SocketCallbackFunc
// contains filtered or unexported fields
}
Client 客户端
func (*Client) CloseChannel ¶
func (*Client) ConnectByIce ¶
ConnectByIce 通过Ice连接
-param conn:通过Ice获取到的连接 -param dummyAddr:通过ice获取的连接的目标地址,注意:因为使用的是已知打通的 PacketConn,Target Address 可以使用 Dummy 虚拟地址
return: 返回错误
func (*Client) ConnectToNet ¶
func (cli *Client) ConnectToNet(channelCount int, conn net.PacketConn, addr net.Addr, onDisconnect network.SocketCallbackFunc) error
Click to show internal directories.
Click to hide internal directories.