mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
Searches called from api.go, various other tweaks, searches now have a callback for success/failure, node ID now reported by admin socket
This commit is contained in:
parent
eef2a02d0a
commit
160e01e84f
7 changed files with 177 additions and 81 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"golang.org/x/text/encoding/unicode"
|
||||
|
||||
|
@ -267,6 +268,18 @@ func main() {
|
|||
defer func() {
|
||||
n.core.Stop()
|
||||
}()
|
||||
// Some stuff
|
||||
go func() {
|
||||
time.Sleep(time.Second * 2)
|
||||
session, err := n.core.Dial("nodeid", "babd4e4bccb216f77bb723c1b034b63a652060aabfe9506b51f687183e9b0fd13f438876f5a3ab21cac9c8101eb88e2613fe2a8b0724add09d7ef5a72146c31f")
|
||||
logger.Println(session, err)
|
||||
b := []byte{1, 2, 3, 4, 5}
|
||||
for {
|
||||
logger.Println(session.Write(b))
|
||||
logger.Println(session.Read(b))
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
}()
|
||||
// Make some nice output that tells us what our IPv6 address and subnet are.
|
||||
// This is just logged to stdout for the user.
|
||||
address := n.core.Address()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue