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
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
30721918
Commit
30721918
authored
3 years ago
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Minor fixes and add blank README
parent
ae5ea3e0
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1
Connection server
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
connectServer/README.md
+2
-0
2 additions, 0 deletions
connectServer/README.md
connectServer/main.go
+3
-4
3 additions, 4 deletions
connectServer/main.go
with
5 additions
and
4 deletions
connectServer/README.md
0 → 100644
+
2
−
0
View file @
30721918
# xxdk Connection Server Example
This diff is collapsed.
Click to expand it.
connectServer/main.go
+
3
−
4
View file @
30721918
...
@@ -115,11 +115,10 @@ func main() {
...
@@ -115,11 +115,10 @@ func main() {
// Start connection server----------------------------------------------------------
// Start connection server----------------------------------------------------------
// Start the connection server, which
// Start the connection server, which will allow clients to start connections with you
e2eParams
:=
xxdk
.
GetDefaultE2EParams
()
connectionListParams
:=
connect
.
DefaultConnectionListParams
()
connectionListParams
:=
connect
.
DefaultConnectionListParams
()
_
,
err
=
connect
.
StartServer
(
_
,
err
=
connect
.
StartServer
(
identity
,
cb
,
baseClient
,
e2eP
arams
,
connectionListParams
)
identity
,
cb
,
baseClient
,
p
arams
,
connectionListParams
)
if
err
!=
nil
{
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Unable to start connection server: %+v"
,
err
)
jww
.
FATAL
.
Panicf
(
"Unable to start connection server: %+v"
,
err
)
}
}
...
@@ -153,7 +152,7 @@ func main() {
...
@@ -153,7 +152,7 @@ func main() {
// Create a tracker channel to be notified of network changes
// Create a tracker channel to be notified of network changes
connected
:=
make
(
chan
bool
,
10
)
connected
:=
make
(
chan
bool
,
10
)
// Provide a callback that will be signalled when network health status changes
// Provide a callback that will be signalled when network health status changes
bas
eClient
.
GetCmix
()
.
AddHealthCallback
(
e2
eClient
.
GetCmix
()
.
AddHealthCallback
(
func
(
isConnected
bool
)
{
func
(
isConnected
bool
)
{
connected
<-
isConnected
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