Exemplo n.º 1
0
Arquivo: server.go Projeto: bsn069/go
func NewSNetServer(vINetServerImp INetServerImp) (*SNetServer, error) {
	GSLog.Debugln("NewSNetServer")
	this := &SNetServer{}
	this.M_INetServerImp = vINetServerImp
	this.SNetListener, _ = NewSNetListener()
	this.SState = bsn_common.NewSState()
	this.SNotifyClose = bsn_common.NewSNotifyClose()
	return this, nil
}
Exemplo n.º 2
0
func NewSNetListener() (*SNetListener, error) {
	GSLog.Debugln("NewSNetListener")
	this := &SNetListener{
		M_chanConn: make(bsn_common.TNetChanConn, 100),
	}
	this.SState = bsn_common.NewSState()
	this.SNotifyClose = bsn_common.NewSNotifyClose()

	return this, nil
}
Exemplo n.º 3
0
func NewSClientUser(vSClientUserMgr *SClientUserMgr) (*SClientUser, error) {
	GSLog.Debugln("NewSClientUser")
	this := &SClientUser{
		M_SClientUserMgr: vSClientUserMgr,
	}
	this.SSessionWithMsgHeader, _ = bsn_net.NewSSessionWithMsgHeader()
	this.SState = bsn_common.NewSState()
	this.SNotifyClose = bsn_common.NewSNotifyClose()
	return this, nil
}
Exemplo n.º 4
0
func NewNetConnecter(vINetConnecterImp INetConnecterImp) (*SNetConnecter, error) {
	GSLog.Debugln("NewNetConnecter")

	this := &SNetConnecter{}
	this.M_INetConnecterImp = vINetConnecterImp
	this.SSessionAddrConnect, _ = NewSSessionAddrConnect()
	this.SState = bsn_common.NewSState()
	this.SNotifyClose = bsn_common.NewSNotifyClose()

	return this, nil
}
Exemplo n.º 5
0
func NewSClientUser(vSClientUserMgr *SClientUserMgr) (*SClientUser, error) {
	GSLog.Debugln("NewSClientUser")
	this := &SClientUser{
		M_SClientUserMgr: vSClientUserMgr,
		M_TClientId:      0,
		M_byRecvBuff:     make([]byte, 4),
		M_SMsgHeader:     new(bsn_msg.SMsgHeader),
	}
	this.SSession, _ = bsn_net.NewSSession()
	this.SState = bsn_common.NewSState()
	this.SNotifyClose = bsn_common.NewSNotifyClose()

	return this, nil
}