Documentation ¶
Index ¶
- func NewGenericPeer(peerType, name, addr string, q cellnet.EventQueue) cellnet.GenericPeer
- func NewPeer(peerType string) cellnet.Peer
- func PeerCreatorList() (ret []string)
- func RegisterPeerCreator(f PeerCreateFunc)
- type CoreContextSet
- type CorePeerProperty
- func (self *CorePeerProperty) Address() string
- func (self *CorePeerProperty) Name() string
- func (self *CorePeerProperty) NameOrAddress() string
- func (self *CorePeerProperty) Queue() cellnet.EventQueue
- func (self *CorePeerProperty) SetAddress(v string)
- func (self *CorePeerProperty) SetName(v string)
- func (self *CorePeerProperty) SetQueue(v cellnet.EventQueue)
- type CoreProcBundle
- func (self *CoreProcBundle) GetBundle() *CoreProcBundle
- func (self *CoreProcBundle) PostEvent(ev cellnet.Event)
- func (self *CoreProcBundle) ReadMessage(ses cellnet.Session) (msg interface{}, err error)
- func (self *CoreProcBundle) SendMessage(ev cellnet.Event)
- func (self *CoreProcBundle) SetCallback(v cellnet.EventCallback)
- func (self *CoreProcBundle) SetHooker(v cellnet.EventHooker)
- func (self *CoreProcBundle) SetTransmitter(v cellnet.MessageTransmitter)
- type CoreRunningTag
- type CoreSessionIdentify
- type CoreSessionManager
- func (self *CoreSessionManager) Add(ses cellnet.Session)
- func (self *CoreSessionManager) CloseAllSession()
- func (self *CoreSessionManager) Count() int
- func (self *CoreSessionManager) GetSession(id int64) cellnet.Session
- func (self *CoreSessionManager) Remove(ses cellnet.Session)
- func (self *CoreSessionManager) SessionCount() int
- func (self *CoreSessionManager) SetIDBase(base int64)
- func (self *CoreSessionManager) VisitSession(callback func(cellnet.Session) bool)
- type CoreTCPSocketOption
- func (self *CoreTCPSocketOption) ApplySocketOption(conn net.Conn)
- func (self *CoreTCPSocketOption) ApplySocketReadTimeout(conn net.Conn, callback func())
- func (self *CoreTCPSocketOption) ApplySocketWriteTimeout(conn net.Conn, callback func())
- func (self *CoreTCPSocketOption) Init()
- func (self *CoreTCPSocketOption) MaxPacketSize() int
- func (self *CoreTCPSocketOption) SetMaxPacketSize(maxSize int)
- func (self *CoreTCPSocketOption) SetSocketBuffer(readBufferSize, writeBufferSize int, noDelay bool)
- func (self *CoreTCPSocketOption) SetSocketDeadline(read, write time.Duration)
- type MessagePoster
- type PeerCreateFunc
- type SessionManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGenericPeer ¶
func NewGenericPeer(peerType, name, addr string, q cellnet.EventQueue) cellnet.GenericPeer
创建Peer后,设置基本属性
Types ¶
type CoreContextSet ¶
type CoreContextSet struct {
// contains filtered or unexported fields
}
上下文记录,绑定用户自定义数据
func (*CoreContextSet) FetchContext ¶
func (self *CoreContextSet) FetchContext(key, valuePtr interface{}) bool
func (*CoreContextSet) GetContext ¶
func (self *CoreContextSet) GetContext(key interface{}) (interface{}, bool)
func (*CoreContextSet) SetContext ¶
func (self *CoreContextSet) SetContext(key, v interface{})
type CorePeerProperty ¶
type CorePeerProperty struct {
// contains filtered or unexported fields
}
func (*CorePeerProperty) Address ¶
func (self *CorePeerProperty) Address() string
获取SetAddress中的侦听或者连接地址
func (*CorePeerProperty) NameOrAddress ¶
func (self *CorePeerProperty) NameOrAddress() string
func (*CorePeerProperty) SetAddress ¶
func (self *CorePeerProperty) SetAddress(v string)
func (*CorePeerProperty) SetName ¶
func (self *CorePeerProperty) SetName(v string)
func (*CorePeerProperty) SetQueue ¶
func (self *CorePeerProperty) SetQueue(v cellnet.EventQueue)
type CoreProcBundle ¶
type CoreProcBundle struct {
// contains filtered or unexported fields
}
func (*CoreProcBundle) GetBundle ¶
func (self *CoreProcBundle) GetBundle() *CoreProcBundle
func (*CoreProcBundle) PostEvent ¶
func (self *CoreProcBundle) PostEvent(ev cellnet.Event)
func (*CoreProcBundle) ReadMessage ¶
func (self *CoreProcBundle) ReadMessage(ses cellnet.Session) (msg interface{}, err error)
func (*CoreProcBundle) SendMessage ¶
func (self *CoreProcBundle) SendMessage(ev cellnet.Event)
func (*CoreProcBundle) SetCallback ¶
func (self *CoreProcBundle) SetCallback(v cellnet.EventCallback)
func (*CoreProcBundle) SetHooker ¶
func (self *CoreProcBundle) SetHooker(v cellnet.EventHooker)
func (*CoreProcBundle) SetTransmitter ¶
func (self *CoreProcBundle) SetTransmitter(v cellnet.MessageTransmitter)
type CoreRunningTag ¶
type CoreRunningTag struct {
// contains filtered or unexported fields
}
通信通讯端共享的数据
func (*CoreRunningTag) EndStopping ¶
func (self *CoreRunningTag) EndStopping()
func (*CoreRunningTag) IsRunning ¶
func (self *CoreRunningTag) IsRunning() bool
func (*CoreRunningTag) IsStopping ¶
func (self *CoreRunningTag) IsStopping() bool
func (*CoreRunningTag) SetRunning ¶
func (self *CoreRunningTag) SetRunning(v bool)
func (*CoreRunningTag) StartStopping ¶
func (self *CoreRunningTag) StartStopping()
func (*CoreRunningTag) WaitStopFinished ¶
func (self *CoreRunningTag) WaitStopFinished()
type CoreSessionIdentify ¶
type CoreSessionIdentify struct {
// contains filtered or unexported fields
}
func (*CoreSessionIdentify) ID ¶
func (self *CoreSessionIdentify) ID() int64
func (*CoreSessionIdentify) SetID ¶
func (self *CoreSessionIdentify) SetID(id int64)
type CoreSessionManager ¶
type CoreSessionManager struct {
// contains filtered or unexported fields
}
func (*CoreSessionManager) Add ¶
func (self *CoreSessionManager) Add(ses cellnet.Session)
func (*CoreSessionManager) CloseAllSession ¶
func (self *CoreSessionManager) CloseAllSession()
func (*CoreSessionManager) Count ¶
func (self *CoreSessionManager) Count() int
func (*CoreSessionManager) GetSession ¶
func (self *CoreSessionManager) GetSession(id int64) cellnet.Session
获得一个连接
func (*CoreSessionManager) Remove ¶
func (self *CoreSessionManager) Remove(ses cellnet.Session)
func (*CoreSessionManager) SessionCount ¶
func (self *CoreSessionManager) SessionCount() int
活跃的会话数量
func (*CoreSessionManager) SetIDBase ¶
func (self *CoreSessionManager) SetIDBase(base int64)
func (*CoreSessionManager) VisitSession ¶
func (self *CoreSessionManager) VisitSession(callback func(cellnet.Session) bool)
type CoreTCPSocketOption ¶
type CoreTCPSocketOption struct {
// contains filtered or unexported fields
}
func (*CoreTCPSocketOption) ApplySocketOption ¶
func (self *CoreTCPSocketOption) ApplySocketOption(conn net.Conn)
func (*CoreTCPSocketOption) ApplySocketReadTimeout ¶
func (self *CoreTCPSocketOption) ApplySocketReadTimeout(conn net.Conn, callback func())
func (*CoreTCPSocketOption) ApplySocketWriteTimeout ¶
func (self *CoreTCPSocketOption) ApplySocketWriteTimeout(conn net.Conn, callback func())
func (*CoreTCPSocketOption) Init ¶
func (self *CoreTCPSocketOption) Init()
func (*CoreTCPSocketOption) MaxPacketSize ¶
func (self *CoreTCPSocketOption) MaxPacketSize() int
func (*CoreTCPSocketOption) SetMaxPacketSize ¶
func (self *CoreTCPSocketOption) SetMaxPacketSize(maxSize int)
func (*CoreTCPSocketOption) SetSocketBuffer ¶
func (self *CoreTCPSocketOption) SetSocketBuffer(readBufferSize, writeBufferSize int, noDelay bool)
func (*CoreTCPSocketOption) SetSocketDeadline ¶
func (self *CoreTCPSocketOption) SetSocketDeadline(read, write time.Duration)
type MessagePoster ¶
手动投递消息, 兼容v2的设计
type PeerCreateFunc ¶
type SessionManager ¶
type SessionManager interface { cellnet.SessionAccessor Add(cellnet.Session) Remove(cellnet.Session) Count() int // 设置ID开始的号 SetIDBase(base int64) }
完整功能的会话管理
Source Files ¶
Click to show internal directories.
Click to hide internal directories.