diff --git a/pkg/messaging/client.go b/pkg/messaging/factory.go similarity index 99% rename from pkg/messaging/client.go rename to pkg/messaging/factory.go index 394edddf21..b35fff7444 100644 --- a/pkg/messaging/client.go +++ b/pkg/messaging/factory.go @@ -39,7 +39,7 @@ type clientLink struct { chans *chanList } -// Config configures Client. +// Config configures MsgFactory type Config struct { PubKey cipher.PubKey SecKey cipher.SecKey diff --git a/pkg/messaging/client_no_ci_test.go b/pkg/messaging/factory_noci_test.go similarity index 100% rename from pkg/messaging/client_no_ci_test.go rename to pkg/messaging/factory_noci_test.go diff --git a/pkg/messaging/client_test.go b/pkg/messaging/factory_test.go similarity index 100% rename from pkg/messaging/client_test.go rename to pkg/messaging/factory_test.go diff --git a/pkg/transport/managed_transport.go b/pkg/transport/managed_transport.go index 091fc3c487..943dc47ba8 100644 --- a/pkg/transport/managed_transport.go +++ b/pkg/transport/managed_transport.go @@ -3,6 +3,7 @@ package transport import ( "math/big" "sync" + "sync/atomic" "github.com/google/uuid" ) diff --git a/pkg/transport/manager.go b/pkg/transport/manager.go index cabb1832ea..e79ad09a7e 100644 --- a/pkg/transport/manager.go +++ b/pkg/transport/manager.go @@ -6,6 +6,7 @@ import ( "math/big" "strings" "sync" + "sync/atomic" "time" "github.com/google/uuid" @@ -58,10 +59,8 @@ func NewManager(config *ManagerConfig, factories ...Factory) (*Manager, error) { factories: fMap, transports: make(map[uuid.UUID]*ManagedTransport), entries: mEntries, - // AcceptedTrChan: make(chan *ManagedTransport, 10), - // DialedTrChan: make(chan *ManagedTransport, 10), - TrChan: make(chan *ManagedTransport, 9), //IDK why it was 10 before - doneChan: make(chan struct{}), + TrChan: make(chan *ManagedTransport, 9), // TODO: eliminate or justify buffering here + doneChan: make(chan struct{}), }, nil }