server

package
v0.0.0-...-440800f Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnStateListener

func ConnStateListener(c net.Conn, cs http.ConnState)

ConnStateListener bound to server and maintains a list of connections by pointer

Types

type HttpListener

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

func (*HttpListener) Accept

func (l *HttpListener) Accept() (net.Conn, error)

func (*HttpListener) Addr

func (l *HttpListener) Addr() net.Addr

func (*HttpListener) Close

func (l *HttpListener) Close() error

type MultiProtoHttpCodec

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

func NewMultiProtoHttpCodec

func NewMultiProtoHttpCodec(conn *TcpConnWrapper) *MultiProtoHttpCodec

func (*MultiProtoHttpCodec) Close

func (m *MultiProtoHttpCodec) Close() error

func (*MultiProtoHttpCodec) Context

func (c *MultiProtoHttpCodec) Context() interface{}

func (*MultiProtoHttpCodec) Receive

func (m *MultiProtoHttpCodec) Receive() (interface{}, error)

func (*MultiProtoHttpCodec) Send

func (m *MultiProtoHttpCodec) Send(msg interface{}) error

type MultiProtoInsance

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

func (*MultiProtoInsance) Destroy

func (s *MultiProtoInsance) Destroy()

func (*MultiProtoInsance) Initialize

func (s *MultiProtoInsance) Initialize() error

func (*MultiProtoInsance) RunLoop

func (s *MultiProtoInsance) RunLoop()

type MultiProtoProxy

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

func NewMultiProtoProxy

func NewMultiProtoProxy() *MultiProtoProxy

func (*MultiProtoProxy) NewCodec

func (m *MultiProtoProxy) NewCodec(rw io.ReadWriter) (net2.Codec, error)

type MultiProtoProxyCodec

type MultiProtoProxyCodec struct {
	State int
	// contains filtered or unexported fields
}

func (*MultiProtoProxyCodec) Close

func (c *MultiProtoProxyCodec) Close() error

func (*MultiProtoProxyCodec) Context

func (c *MultiProtoProxyCodec) Context() interface{}

func (*MultiProtoProxyCodec) Receive

func (c *MultiProtoProxyCodec) Receive() (interface{}, error)

func (*MultiProtoProxyCodec) Send

func (c *MultiProtoProxyCodec) Send(msg interface{}) error

type MultiProtoServer

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

func NewMultiProtoServer

func NewMultiProtoServer(listener net.Listener, protoName string) *MultiProtoServer

func (*MultiProtoServer) OnConnectionClosed

func (s *MultiProtoServer) OnConnectionClosed(conn *net2.TcpConnection)

func (*MultiProtoServer) OnConnectionDataArrived

func (s *MultiProtoServer) OnConnectionDataArrived(conn *net2.TcpConnection, msg interface{}) error

func (*MultiProtoServer) OnNewConnection

func (s *MultiProtoServer) OnNewConnection(conn *net2.TcpConnection)

func (*MultiProtoServer) Serve

func (s *MultiProtoServer) Serve()

type TcpConnWrapper

type TcpConnWrapper struct {
	RecvChan chan interface{}
	SendChan chan interface{}
	// contains filtered or unexported fields
}

func NewTcpConnWrapper

func NewTcpConnWrapper(base net.Conn) (conn *TcpConnWrapper)

func (*TcpConnWrapper) Close

func (c *TcpConnWrapper) Close() error

func (*TcpConnWrapper) LocalAddr

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

func (*TcpConnWrapper) Peek

func (c *TcpConnWrapper) Peek(n int) ([]byte, error)

func (*TcpConnWrapper) Read

func (c *TcpConnWrapper) Read(b []byte) (n int, err error)

func (*TcpConnWrapper) RemoteAddr

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

func (*TcpConnWrapper) SetDeadline

func (c *TcpConnWrapper) SetDeadline(t time.Time) error

func (*TcpConnWrapper) SetReadDeadline

func (c *TcpConnWrapper) SetReadDeadline(t time.Time) error

func (*TcpConnWrapper) SetWriteDeadline

func (c *TcpConnWrapper) SetWriteDeadline(t time.Time) error

func (*TcpConnWrapper) WrapBaseForTest

func (c *TcpConnWrapper) WrapBaseForTest(wrap func(net.Conn) net.Conn)

func (*TcpConnWrapper) Write

func (c *TcpConnWrapper) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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