Documentation ¶
Index ¶
Constants ¶
View Source
const ( READCHAN_SIZE = 1024 WRITECHAN_SIZE = 0 )
Variables ¶
View Source
var ( ErrSessionClosing = errors.New("use of closed network connection") ErrBufferFull = errors.New("the async buffer is full") )
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { Addr string //TCP address to listen on Listen *net.TCPListener Handler Handler Sessions SessionBucket // contains filtered or unexported fields }
func (*Server) ListenAndServe ¶
func (*Server) SetMaxPacketSize ¶
在ListenAndServe之前调用
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) RemoteAddr ¶
func (*Session) RemoteIPAddr ¶
type SessionBucket ¶
type SessionBucket struct {
// contains filtered or unexported fields
}
func (*SessionBucket) Add ¶
func (sb *SessionBucket) Add(sess *Session)
func (*SessionBucket) All ¶
func (sb *SessionBucket) All() map[string]*Session
func (*SessionBucket) Delete ¶
func (sb *SessionBucket) Delete(ip string)
func (*SessionBucket) Get ¶
func (sb *SessionBucket) Get(ip string) *Session
Click to show internal directories.
Click to hide internal directories.