Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk Examples
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
elixxir
xxdk Examples
Commits
d641dec7
Commit
d641dec7
authored
Jul 6, 2022
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Remove duplicate e2e client creation in connection server
parent
bbe4e492
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
connectServer/main.go
+5
-13
5 additions, 13 deletions
connectServer/main.go
with
5 additions
and
13 deletions
connectServer/main.go
+
5
−
13
View file @
d641dec7
...
...
@@ -86,15 +86,6 @@ func main() {
}
}
// Create an E2E client
// The connect packages handles AuthCallbacks, xxdk.DefaultAuthCallbacks is fine here
params
:=
xxdk
.
GetDefaultE2EParams
()
jww
.
INFO
.
Printf
(
"Using E2E parameters: %+v"
,
params
)
e2eClient
,
err
:=
xxdk
.
Login
(
baseClient
,
xxdk
.
DefaultAuthCallbacks
{},
identity
,
params
)
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Unable to Login: %+v"
,
err
)
}
// Save contact file----------------------------------------------------------------
// Save the contact file so that client can connect to this server
...
...
@@ -116,9 +107,10 @@ func main() {
// Start connection server----------------------------------------------------------
// Start the connection server, which will allow clients to start connections with you
e2eParams
:=
xxdk
.
GetDefaultE2EParams
()
connectionListParams
:=
connect
.
DefaultConnectionListParams
()
_
,
err
=
connect
.
StartServer
(
identity
,
cb
,
baseClient
,
p
arams
,
connectionListParams
)
connectServer
,
err
:
=
connect
.
StartServer
(
identity
,
cb
,
baseClient
,
e2eP
arams
,
connectionListParams
)
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Unable to start connection server: %+v"
,
err
)
}
...
...
@@ -127,7 +119,7 @@ func main() {
// Set networkFollowerTimeout to a value of your choice (seconds)
networkFollowerTimeout
:=
5
*
time
.
Second
err
=
e2eClient
.
StartNetworkFollower
(
networkFollowerTimeout
)
err
=
connectServer
.
E2e
.
StartNetworkFollower
(
networkFollowerTimeout
)
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Failed to start network follower: %+v"
,
err
)
}
...
...
@@ -152,7 +144,7 @@ func main() {
// Create a tracker channel to be notified of network changes
connected
:=
make
(
chan
bool
,
10
)
// Provide a callback that will be signalled when network health status changes
e2eClient
.
GetCmix
()
.
AddHealthCallback
(
connectServer
.
E2e
.
GetCmix
()
.
AddHealthCallback
(
func
(
isConnected
bool
)
{
connected
<-
isConnected
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment