add *Server argument to NewServerStream()

This commit is contained in:
aler9
2023-08-12 20:19:29 +02:00
parent ca87733ded
commit 68d4bf8da0
10 changed files with 191 additions and 156 deletions

View File

@@ -1,14 +1,21 @@
package main
import "log"
// This example shows how to
// 1. read an existing stream from an external server or camera, with a client
// 2. create a server that allow to proxy that stream
// 1. create a server that allow to serve a stream.
// 2. create a client, read an existing stream from an external server or camera,
// pass the stream to the server in order to serve it.
func main() {
// allocate the client
c := newClient()
// allocate the server.
// give server access to the method client.getStream().
newServer(c.getStream)
s := newServer()
// allocate the client.
// give client access to the server.
newClient(s)
// start server and wait until a fatal error
log.Printf("server is ready")
s.s.StartAndWait()
}