Ejemplo n.º 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
}
Ejemplo n.º 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
}