示例#1
0
func NewConnector(pipe cellnet.EventPipe) cellnet.Peer {
	self := &socketConnector{
		sessionMgr:  newSessionManager(),
		peerProfile: newPeerProfile(pipe.AddQueue()),
		closeSignal: make(chan bool),
	}

	self.PostData(NewPeerEvent(Event_PeerInit, self))

	return self
}
示例#2
0
func NewAcceptor(pipe cellnet.EventPipe) cellnet.Peer {

	self := &socketAcceptor{
		sessionMgr:  newSessionManager(),
		peerProfile: newPeerProfile(pipe.AddQueue()),
	}

	self.PostData(NewPeerEvent(Event_PeerInit, self))

	return self
}