Documentation ¶
Index ¶
- Constants
- Variables
- type BroadcastProtocol
- type BufioCodecType
- type Channel
- type Codec
- type CodecType
- type SelfDecoder
- type SelfEncoder
- type Server
- type Session
- func (session *Session) AddCloseCallback(handler interface{}, callback func())
- func (session *Session) AsyncSend(msg interface{}) error
- func (session *Session) Close()
- func (session *Session) Conn() net.Conn
- func (session *Session) EnableAsyncSend(sendChanSize int)
- func (session *Session) Id() uint64
- func (session *Session) IsClosed() bool
- func (session *Session) Receive(msg interface{}) (err error)
- func (session *Session) RemoveCloseCallback(handler interface{})
- func (session *Session) Send(msg interface{}) (err error)
- type SessionFetcher
Constants ¶
View Source
const DEFAULT_BUFFER_SIZE = 4096
Variables ¶
View Source
var ( Line = binary.SplitByLine Null = binary.SplitByNull Uvarint = binary.SplitByUvarint Uint8 = binary.SplitByUint8 Uint16BE = binary.SplitByUint16BE Uint16LE = binary.SplitByUint16LE Uint24BE = binary.SplitByUint24BE Uint24LE = binary.SplitByUint24LE Uint32BE = binary.SplitByUint32BE Uint32LE = binary.SplitByUint32LE Uint40BE = binary.SplitByUint40BE Uint40LE = binary.SplitByUint40LE Uint48BE = binary.SplitByUint48BE Uint48LE = binary.SplitByUint48LE Uint56BE = binary.SplitByUint56BE Uint56LE = binary.SplitByUint56LE Uint64BE = binary.SplitByUint64BE Uint64LE = binary.SplitByUint64LE )
View Source
var ( ErrClosed = errors.New("Session closed") ErrBlocking = errors.New("Operation blocking") )
Functions ¶
This section is empty.
Types ¶
type BroadcastProtocol ¶
type BroadcastProtocol interface {
Broadcast(msg interface{}, fetcher SessionFetcher) error
}
type BufioCodecType ¶
func Bufio ¶
func Bufio(codecType CodecType) *BufioCodecType
type Channel ¶
type Channel struct { // channel state State interface{} // contains filtered or unexported fields }
func NewChannel ¶
func NewChannel() *Channel
func NewCustomChannel ¶
func NewCustomChannel(protocol BroadcastProtocol) *Channel
type SelfDecoder ¶
type SelfEncoder ¶
type Server ¶
type Server struct { // Server state State interface{} // contains filtered or unexported fields }
type Session ¶
type Session struct { // Session state State interface{} // contains filtered or unexported fields }
func ConnectTimeout ¶
func (*Session) AddCloseCallback ¶
func (session *Session) AddCloseCallback(handler interface{}, callback func())
func (*Session) EnableAsyncSend ¶
func (*Session) RemoveCloseCallback ¶
func (session *Session) RemoveCloseCallback(handler interface{})
type SessionFetcher ¶
type SessionFetcher func(func(*Session))
Source Files ¶
Click to show internal directories.
Click to hide internal directories.