Documentation ¶
Index ¶
- Constants
- type ByteRingBuffer
- type CloseRead
- type CloseWrite
- type Connection
- type HalfOpenConn
- type InboundConnection
- func (c *InboundConnection) Close() error
- func (c *InboundConnection) CloseRead() error
- func (c *InboundConnection) CloseWrite() error
- func (bc *InboundConnection) GetConnectionID() uint32
- func (c *InboundConnection) LocalAddr() net.Addr
- func (bc *InboundConnection) OrderedRelay(connection Connection)
- func (c *InboundConnection) Read(b []byte) (n int, err error)
- func (bc *InboundConnection) RecvBlock(blk block.Block)
- func (c *InboundConnection) RemoteAddr() net.Addr
- func (bc *InboundConnection) SendConnect(address string)
- func (bc *InboundConnection) SendDisconnect(shutdownType uint8)
- func (c *InboundConnection) SetDeadline(t time.Time) error
- func (c *InboundConnection) SetReadDeadline(t time.Time) error
- func (c *InboundConnection) SetWriteDeadline(t time.Time) error
- func (bc *InboundConnection) Stop()
- func (c *InboundConnection) Write(b []byte) (n int, err error)
- type OutboundConnection
- func (bc *OutboundConnection) GetConnectionID() uint32
- func (bc *OutboundConnection) OrderedRelay(connection Connection)
- func (oc *OutboundConnection) RecvBlock(blk block.Block)
- func (oc *OutboundConnection) RecvRelay()
- func (bc *OutboundConnection) SendConnect(address string)
- func (bc *OutboundConnection) SendDisconnect(shutdownType uint8)
- func (oc *OutboundConnection) SendRelay()
- func (bc *OutboundConnection) Stop()
Constants ¶
View Source
const ( OrderedRecvQueueSize = 24 // OrderedRecvQueue channel cap RecvQueueSize = 24 // RecvQueue channel cap OutboundRecvBuffer = 16 * 1024 // 16K receive buffer for Outbound Connection OutboundBlockTimeoutSec = 3 // Wait the period and check exit signal PacketWaitTimeoutSec = 7 // If block processor is waiting for a "hole", and no packet comes within this limit, the Connection will be closed )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteRingBuffer ¶
type ByteRingBuffer struct {
// contains filtered or unexported fields
}
func NewByteRingBuffer ¶
func NewByteRingBuffer(size uint32) ByteRingBuffer
func (*ByteRingBuffer) Empty ¶
func (rb *ByteRingBuffer) Empty() bool
func (*ByteRingBuffer) OverWrite ¶
func (rb *ByteRingBuffer) OverWrite(data []byte)
func (*ByteRingBuffer) Read ¶
func (rb *ByteRingBuffer) Read(data []byte) int
type CloseWrite ¶ added in v1.0.7
type CloseWrite interface {
CloseWrite() error
}
type Connection ¶
type Connection interface { HalfOpenConn GetConnectionID() uint32 RecvBlock(block.Block) SendConnect(address string) SendDisconnect(uint8) OrderedRelay(connection Connection) // Run orderedRelay infinitely Stop() // Stop all related relay and remove itself from connectionPool // contains filtered or unexported methods }
func NewInboundConnection ¶
func NewInboundConnection(sendQueue chan<- block.Block, ctx context.Context, removeFromPool context.CancelFunc) Connection
func NewOutboundConnection ¶
func NewOutboundConnection(connectionID uint32, sendQueue chan<- block.Block, ctx context.Context, removeFromPool context.CancelFunc) Connection
type HalfOpenConn ¶ added in v1.0.7
type InboundConnection ¶
type InboundConnection struct {
// contains filtered or unexported fields
}
func (*InboundConnection) Close ¶
func (c *InboundConnection) Close() error
func (*InboundConnection) CloseRead ¶ added in v1.0.7
func (c *InboundConnection) CloseRead() error
func (*InboundConnection) CloseWrite ¶ added in v1.0.7
func (c *InboundConnection) CloseWrite() error
func (*InboundConnection) GetConnectionID ¶
func (bc *InboundConnection) GetConnectionID() uint32
func (*InboundConnection) LocalAddr ¶
func (c *InboundConnection) LocalAddr() net.Addr
func (*InboundConnection) OrderedRelay ¶
func (bc *InboundConnection) OrderedRelay(connection Connection)
func (*InboundConnection) RemoteAddr ¶
func (c *InboundConnection) RemoteAddr() net.Addr
func (*InboundConnection) SendConnect ¶
func (bc *InboundConnection) SendConnect(address string)
func (*InboundConnection) SendDisconnect ¶
func (bc *InboundConnection) SendDisconnect(shutdownType uint8)
func (*InboundConnection) SetDeadline ¶
func (c *InboundConnection) SetDeadline(t time.Time) error
func (*InboundConnection) SetReadDeadline ¶
func (c *InboundConnection) SetReadDeadline(t time.Time) error
func (*InboundConnection) SetWriteDeadline ¶
func (c *InboundConnection) SetWriteDeadline(t time.Time) error
type OutboundConnection ¶
type OutboundConnection struct { HalfOpenConn // contains filtered or unexported fields }
func (*OutboundConnection) GetConnectionID ¶
func (bc *OutboundConnection) GetConnectionID() uint32
func (*OutboundConnection) OrderedRelay ¶
func (bc *OutboundConnection) OrderedRelay(connection Connection)
func (*OutboundConnection) RecvBlock ¶
func (oc *OutboundConnection) RecvBlock(blk block.Block)
func (*OutboundConnection) RecvRelay ¶
func (oc *OutboundConnection) RecvRelay()
real connection -> ConnectionPool's SendQueue -> TunnelPool
func (*OutboundConnection) SendConnect ¶
func (bc *OutboundConnection) SendConnect(address string)
func (*OutboundConnection) SendDisconnect ¶
func (bc *OutboundConnection) SendDisconnect(shutdownType uint8)
func (*OutboundConnection) SendRelay ¶
func (oc *OutboundConnection) SendRelay()
orderedRecvQueue -> real connection
Click to show internal directories.
Click to hide internal directories.