server

package
v0.0.0-...-6d0c0f3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MaxStreamCount = 6

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Sockets  map[string]*network.Socket
	NetConn  net.PacketConn
	QuicConn *quic.Conn

	OnAcceptSocket       network.SocketCallbackFunc
	OnSocketDisConnected network.SocketCallbackFunc

	network.Config
	ice.IceWorker
	framework.CloseableObject
	// contains filtered or unexported fields
}

func NewServer

func NewServer(conn net.PacketConn, isAgent bool) *Server

NewServer 创建新的服务实例

func NewServerByAddress

func NewServerByAddress(address string) *Server

NewServerByAddress 创建新的服务实例,根据设置的地址监听

func (*Server) CloseSocket

func (s *Server) CloseSocket(id string) error

func (*Server) ConnectByIce

func (s *Server) ConnectByIce(conn net.PacketConn)

func (*Server) GetSocket

func (s *Server) GetSocket(id string) *network.Socket

func (*Server) OnClosed

func (s *Server) OnClosed() error

func (*Server) OnClosing

func (s *Server) OnClosing() bool

func (*Server) StartListen

func (s *Server) StartListen(onDisconnect network.SocketCallbackFunc)

type Stream

type Stream struct {
	Info   *network.StreamInfo
	Stream *quic.Stream
	Server *Server
}

Jump to

Keyboard shortcuts

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