Skip to content
Snippets Groups Projects
Commit 9ec2d7b0 authored by Jake Taylor's avatar Jake Taylor
Browse files

hostpool improvements

parent 2af0c4fd
No related branches found
No related tags found
No related merge requests found
......@@ -199,7 +199,7 @@ func OpenClient(storageDir string, password []byte, parameters params.Network) (
return c, nil
}
// Login initalizes a client object from existing storage.
// Login initializes a client object from existing storage.
func Login(storageDir string, password []byte, parameters params.Network) (*Client, error) {
jww.INFO.Printf("Login()")
......@@ -233,7 +233,7 @@ func Login(storageDir string, password []byte, parameters params.Network) (*Clie
}
} else {
jww.WARN.Printf("Registration with permissioning skipped due to " +
"blank permissionign address. Client will not be able to register " +
"blank permissioning address. Client will not be able to register " +
"or track network.")
}
......@@ -342,7 +342,7 @@ func (c *Client) initPermissioning(def *ndf.NetworkDefinition) error {
jww.ERROR.Printf("Client has failed registration: %s", err)
return errors.WithMessage(err, "failed to load client")
}
jww.INFO.Printf("Client sucsecfully registered with the network")
jww.INFO.Printf("Client successfully registered with the network")
}
return nil
}
......
......@@ -215,7 +215,8 @@ func (h *HostPool) pruneHostPool() error {
// Verify the NDF has at least as many Gateways as needed for the HostPool
ndfLen := uint32(len(h.ndf.Gateways))
if ndfLen == 0 || ndfLen < h.poolParams.PoolSize {
return errors.Errorf("no gateways available")
return errors.Errorf("Unable to pruneHostPool: %d/%d gateways available",
len(h.ndf.Gateways), h.poolParams.PoolSize)
}
for poolIdx := uint32(0); poolIdx < h.poolParams.PoolSize; {
......
......@@ -91,8 +91,12 @@ func NewManager(session *storage.Session, switchboard *switchboard.Switchboard,
// Set up gateway.Sender
poolParams := gateway.DefaultPoolParams()
poolParams.PoolSize = 10
m.sender, err = gateway.NewSender(poolParams, rng.GetStream(),
ndf, comms, session, m.NodeRegistration)
if err != nil {
return nil, err
}
//create sub managers
m.message = message.NewManager(m.Internal, m.param.Messages, m.NodeRegistration, m.sender)
......@@ -138,6 +142,9 @@ func (m *manager) Follow(report interfaces.ClientErrorReport) (stoppable.Stoppab
// Round processing
multi.Add(m.round.StartProcessors())
// Message sending
multi.Add(m.sender.StartHostPool())
multi.Add(ephemeral.Track(m.Session, m.ReceptionID))
return multi, nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment