Documentation
¶
Index ¶
- type Client
- type ClientOptions
- func (p *ClientOptions) WithAddress(address string) *ClientOptions
- func (p *ClientOptions) WithHeaderStrategy(strategy xpacket.IHeaderStrategy) *ClientOptions
- func (p *ClientOptions) WithIOut(iOut xcontrol.IOut) *ClientOptions
- func (p *ClientOptions) WithSendChanCapacity(sendChanCapacity uint32) *ClientOptions
- type Remote
- type Server
- type ServerOptions
- func (p *ServerOptions) WithHeaderStrategy(strategy xpacket.IHeaderStrategy) *ServerOptions
- func (p *ServerOptions) WithIOut(iOut xcontrol.IOut) *ServerOptions
- func (p *ServerOptions) WithIsActor(isActor bool) *ServerOptions
- func (p *ServerOptions) WithListenAddress(listenAddress string) *ServerOptions
- func (p *ServerOptions) WithSendChanCapacity(sendChanCapacity uint32) *ServerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
IHandler xnetcommon.IHandler
IRemote xnetcommon.IRemote
}
Client 客户端
func NewClient ¶
func NewClient(handler xnetcommon.IHandler) *Client
type ClientOptions ¶
type ClientOptions struct {
HeaderStrategy xpacket.IHeaderStrategy
xnetcommon.ConnOptions
xnetcommon.KCPOptions
// contains filtered or unexported fields
}
ClientOptions contains options to configure a Server instance. Each option can be set through setter functions. See documentation for each setter function for an explanation of the option.
func (*ClientOptions) WithAddress ¶
func (p *ClientOptions) WithAddress(address string) *ClientOptions
func (*ClientOptions) WithHeaderStrategy ¶
func (p *ClientOptions) WithHeaderStrategy(strategy xpacket.IHeaderStrategy) *ClientOptions
func (*ClientOptions) WithIOut ¶
func (p *ClientOptions) WithIOut(iOut xcontrol.IOut) *ClientOptions
func (*ClientOptions) WithSendChanCapacity ¶
func (p *ClientOptions) WithSendChanCapacity(sendChanCapacity uint32) *ClientOptions
type Remote ¶
type Remote struct {
UDPSession *kcp.UDPSession
*xnetcommon.DefaultRemote
}
Remote 远端信息
func NewRemote ¶
func NewRemote(udpSession *kcp.UDPSession, sendChan chan interface{}, headerStrategy xpacket.IHeaderStrategy) *Remote
func (*Remote) Start ¶
func (p *Remote) Start(connOptions *xnetcommon.ConnOptions, iout xcontrol.IOut, handler xnetcommon.IHandler)
开始
type Server ¶
type Server struct {
IHandler xnetcommon.IHandler
// contains filtered or unexported fields
}
Server 服务端
type ServerOptions ¶
type ServerOptions struct {
HeaderStrategy xpacket.IHeaderStrategy
xnetcommon.ConnOptions
xnetcommon.KCPOptions
xnetcommon.PacketLimitOptions
// contains filtered or unexported fields
}
ServerOptions contains options to serverConfigure a Server instance. Each option can be set through setter functions. See documentation for each setter function for an explanation of the option.
func (*ServerOptions) WithHeaderStrategy ¶
func (p *ServerOptions) WithHeaderStrategy(strategy xpacket.IHeaderStrategy) *ServerOptions
func (*ServerOptions) WithIOut ¶
func (p *ServerOptions) WithIOut(iOut xcontrol.IOut) *ServerOptions
func (*ServerOptions) WithIsActor ¶
func (p *ServerOptions) WithIsActor(isActor bool) *ServerOptions
func (*ServerOptions) WithListenAddress ¶
func (p *ServerOptions) WithListenAddress(listenAddress string) *ServerOptions
func (*ServerOptions) WithSendChanCapacity ¶
func (p *ServerOptions) WithSendChanCapacity(sendChanCapacity uint32) *ServerOptions
Click to show internal directories.
Click to hide internal directories.