native

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetConn

type NetConn struct {
	// contains filtered or unexported fields
}

func Dial

func Dial(kind, addr string) (*NetConn, error)

func NewNetConn

func NewNetConn(conn net.Conn) (*NetConn, error)

func (*NetConn) Close

func (c *NetConn) Close() error

func (*NetConn) LocalAddr

func (c *NetConn) LocalAddr() net.Addr

func (*NetConn) Read

func (c *NetConn) Read(_ int) *readResult

Read asynchronously reads from the connection. A readResult is returned back to the js vm and once the read completes, it can be read from. This allows the js vm to avoid blocking for reads.

func (*NetConn) RemoteAddr

func (c *NetConn) RemoteAddr() net.Addr

func (*NetConn) Write

func (c *NetConn) Write(s string) (n int, err error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func Listen

func Listen(vmp *vm.VM, onConnect goja.Callable, kind, addr string) (*Server, error)

func (*Server) Addr

func (s *Server) Addr() net.Addr

func (*Server) Close

func (s *Server) Close() error

Jump to

Keyboard shortcuts

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