api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(sockType types.SocketType, inst SocketInstance) (err error)

Types

type Socket

type Socket interface {
	Listen() (err error)                                   // bind and listen on address and port
	Accept() Socket                                        // accept connection...
	Connect() (err error)                                  // for tcp/web socket
	Send(data []byte, to ...string) (n int, err error)     // send to...
	Recv(length int) (data []byte, from string, err error) // receive from... if length > 0, will receive the bytes specified.
	Close() (err error)                                    // close socket
	GetLocalAddr() string                                  // get socket local address
	GetRemoteAddr() string                                 // get socket remote address
	GetSocketType() types.SocketType                       // get socket type
}

func NewSocketInstance

func NewSocketInstance(sockType types.SocketType, ui *parser.UrlInfo) (s Socket)

type SocketInstance

type SocketInstance func(ui *parser.UrlInfo) Socket

Jump to

Keyboard shortcuts

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