musique/server
2023-01-06 09:01:52 +01:00
..
proto musique<->server integration 2022-12-16 16:34:52 +01:00
router Log found hosts 2023-01-06 09:01:52 +01:00
.gitignore Known hosts knowladge sharing algorithm; nicks and ports 2022-12-15 00:28:36 +01:00
go.mod Using mDNS to discover remotes 2023-01-02 05:55:48 +01:00
go.sum Using mDNS to discover remotes 2023-01-02 05:55:48 +01:00
handlers.go cleanup of server directory structure 2022-12-14 17:49:14 +01:00
main.go Support OS assining random port for given Musique instance 2023-01-02 07:23:30 +01:00
mdns.go Log found hosts 2023-01-06 09:01:52 +01:00
musique-bridge.go Support OS assining random port for given Musique instance 2023-01-02 07:23:30 +01:00
README.md Known hosts knowladge sharing algorithm; nicks and ports 2022-12-15 00:28:36 +01:00

Server

Development notes

Testing server list synchronisation (2022-12-14)

For ease of testing you can launch N instances of server in N tmux panes.

$ while true; do sleep {n}; echo "======="; ./server -nick {nick} -port {port}; done

where n is increasing for each server to ensure that initial scan would not cover entire task of network scanning.

Next you can use this script to test:

go build
killall server
sleep 4

# Repeat line below for all N servers
echo '{"version":1, "type":"hosts"}' | nc localhost {port} | jq

# Choose one or few that will request synchronization with their remotes
echo '{"version":1, "type":"synchronize-hosts-with-remotes"}' | nc localhost {port} | jq

# Ensure that all synchronisation propagated with enough sleep time
sleep 2

# Repeat line below for all N servers
echo '{"version":1, "type":"hosts"}' | nc localhost {port} | jq