-
Couldn't load subscription status.
- Fork 1
HubManagement
A hub is a remote entity that allows peer encounter of long wide area networks and routed protocols, e.g. IP, see ASAPHub wiki.
In ASAPHub terms: We are on peer side. We want our peer establish a new connection to another peer over a hub. First, we need a connection to a hub.
SharkPeerBasic sharkPeerBasic = …; // discussed later in this section
HubConnectorDescription hubDescription = TCPHubConnectorDescription(“localhost”, 7070, true);
sharkPeerBasic.addHubDescription(HubConnectorDescription hubDescription);We introduced a concept of hub descriptions. It describes how to connect to a hub. Same hub can offer different ways for peers. But that’s not topic of this section.
Code above creates an object that describes a hub connection with TCP. Hub runs on localhost an listens at port 7070. The final trueparameter defines that we allow new TCP connections to be created to communicate with other peers.