Documentation ¶
Index ¶
- Constants
- type Conn
- func (this *Conn) Activate()
- func (this *Conn) Close() error
- func (this *Conn) GetConnTime() time.Time
- func (this *Conn) GetSession() lokas.ISession
- func (this *Conn) GetUserData() interface{}
- func (this *Conn) ServeIO()
- func (this *Conn) SetUserData(userData interface{})
- func (this *Conn) Wait()
- func (this *Conn) Write(data []byte) (int, error)
- type DataBuff
- type DefaultMessageChan
- type IOPumper
- type IdleChecker
- type MessageChan
- type NonBlockingMessageChan
- type TcpPumper
- type WsConnWrapper
- type WsPumper
Constants ¶
View Source
const DefaultReadBuffSize = 8 * 1024
View Source
const DefaultWriteBuffSize = 16 * 1024
View Source
const MinMergedWriteBuffSize = 100 * 1024
View Source
const ProtectLongPacketSize = 8 * 1024 * 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { net.Conn Session lokas.ISession UserData interface{} ConnTime time.Time // contains filtered or unexported fields }
func (*Conn) GetConnTime ¶
func (*Conn) GetSession ¶
func (this *Conn) GetSession() lokas.ISession
func (*Conn) GetUserData ¶
func (this *Conn) GetUserData() interface{}
func (*Conn) SetUserData ¶
func (this *Conn) SetUserData(userData interface{})
type DataBuff ¶
type DataBuff struct {
// contains filtered or unexported fields
}
func NewDataBuff ¶
type DefaultMessageChan ¶
type DefaultMessageChan struct { In chan<- []byte Out <-chan []byte // contains filtered or unexported fields }
func NewDefaultMessageChan ¶
func NewDefaultMessageChan(size int, done chan struct{}) *DefaultMessageChan
func (*DefaultMessageChan) GetInChan ¶
func (this *DefaultMessageChan) GetInChan() chan<- []byte
func (*DefaultMessageChan) GetOutChan ¶
func (this *DefaultMessageChan) GetOutChan() <-chan []byte
func (*DefaultMessageChan) Len ¶
func (this *DefaultMessageChan) Len() int
type IdleChecker ¶
type IdleChecker struct { InitConnChan chan lokas.IConn ActiveConnChan chan lokas.IConn CloseConnChan chan lokas.IConn // contains filtered or unexported fields }
func NewIdleChecker ¶
func NewIdleChecker(duration time.Duration) *IdleChecker
func (*IdleChecker) Stop ¶
func (this *IdleChecker) Stop()
type MessageChan ¶
func NewMessageChan ¶
func NewMessageChan(useNoneBlocking bool, size int, done chan struct{}) MessageChan
type NonBlockingMessageChan ¶
type NonBlockingMessageChan struct { *DefaultMessageChan // contains filtered or unexported fields }
Special type that mimics the behavior of a channel but does not block when items are sent. Items are stored internally until received. Closing the Send channel will cause the Recv channel to be closed after all items have been received.
func NewNonBlockingMessageChan ¶
func NewNonBlockingMessageChan(size int, done chan struct{}) *NonBlockingMessageChan
OnCreate a new non-blocking channel.
func (*NonBlockingMessageChan) Len ¶
func (this *NonBlockingMessageChan) Len() int
Retrieve the number of items waiting to be received.
type WsConnWrapper ¶
wrap websocket.IConn to adopt net.IConn
func (*WsConnWrapper) SetDeadline ¶
func (this *WsConnWrapper) SetDeadline(t time.Time) error
Click to show internal directories.
Click to hide internal directories.