change NewConnClient() signature

This commit is contained in:
aler9
2020-07-13 09:25:39 +02:00
parent d675bad299
commit 025fa58edd
3 changed files with 4 additions and 11 deletions

View File

@@ -49,7 +49,7 @@ type ConnClient struct {
}
// NewConnClient allocates a ConnClient. See ConnClientConf for the options.
func NewConnClient(conf ConnClientConf) (*ConnClient, error) {
func NewConnClient(conf ConnClientConf) *ConnClient {
if conf.ReadTimeout == time.Duration(0) {
conf.ReadTimeout = 5 * time.Second
}
@@ -61,7 +61,7 @@ func NewConnClient(conf ConnClientConf) (*ConnClient, error) {
conf: conf,
br: bufio.NewReaderSize(conf.Conn, clientReadBufferSize),
bw: bufio.NewWriterSize(conf.Conn, clientWriteBufferSize),
}, nil
}
}
// NetConn returns the underlying net.Conn.

View File

@@ -23,10 +23,7 @@ func main() {
}
defer conn.Close()
rconn, err := gortsplib.NewConnClient(gortsplib.ConnClientConf{Conn: conn})
if err != nil {
panic(err)
}
rconn := gortsplib.NewConnClient(gortsplib.ConnClientConf{Conn: conn})
_, err = rconn.Options(u)
if err != nil {
@@ -51,7 +48,6 @@ func main() {
}
frame := &gortsplib.InterleavedFrame{Content: make([]byte, 512*1024)}
for {
err := rconn.ReadFrame(frame)
if err != nil {

View File

@@ -24,10 +24,7 @@ func main() {
}
defer conn.Close()
rconn, err := gortsplib.NewConnClient(gortsplib.ConnClientConf{Conn: conn})
if err != nil {
panic(err)
}
rconn := gortsplib.NewConnClient(gortsplib.ConnClientConf{Conn: conn})
_, err = rconn.Options(u)
if err != nil {