mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 00:03:09 -06:00
Add pinecone listener
This commit is contained in:
parent
5ed6c2be87
commit
39da41c3ba
|
|
@ -59,6 +59,7 @@ var (
|
|||
instanceName = flag.String("name", "dendrite-p2p-pinecone", "the name of this P2P demo instance")
|
||||
instancePort = flag.Int("port", 8008, "the port that the client API will listen on")
|
||||
instancePeer = flag.String("peer", "", "the static Pinecone peer to connect to")
|
||||
instanceListen = flag.String("listen", ":0", "the port Pinecone peers can connect to")
|
||||
)
|
||||
|
||||
// nolint:gocyclo
|
||||
|
|
@ -110,6 +111,29 @@ func main() {
|
|||
}(*instancePeer)
|
||||
}
|
||||
|
||||
go func() {
|
||||
listener, err := net.Listen("tcp", *instanceListen)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println("Listening on", listener.Addr())
|
||||
|
||||
for {
|
||||
conn, err := listener.Accept()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
port, err := pSwitch.AuthenticatedConnect(conn, "")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println("Inbound connection", conn.RemoteAddr(), "is connected to port", port)
|
||||
}
|
||||
}()
|
||||
|
||||
pQUIC := pineconeSessions.NewQUIC(logger, pRouter)
|
||||
_ = pineconeMulticast.NewMulticast(logger, pSwitch)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue