From f6601580db719581f2b040a6f636e669a64c24d3 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Fri, 12 Nov 2021 11:17:50 +0100 Subject: [PATCH] client: remove DialReadContext, DialPublishContext --- client.go | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/client.go b/client.go index 51d14af0..2682ad89 100644 --- a/client.go +++ b/client.go @@ -307,11 +307,6 @@ func (c *Client) Dial(scheme string, host string) error { // DialRead connects to the address and starts reading all tracks. func (c *Client) DialRead(address string) error { - return c.DialReadContext(context.Background(), address) -} - -// DialReadContext connects to the address with the given context and starts reading all tracks. -func (c *Client) DialReadContext(ctx context.Context, address string) error { u, err := base.ParseURL(address) if err != nil { return err @@ -322,21 +317,6 @@ func (c *Client) DialReadContext(ctx context.Context, address string) error { return err } - ctxHandlerDone := make(chan struct{}) - defer func() { <-ctxHandlerDone }() - - ctxHandlerTerminate := make(chan struct{}) - defer close(ctxHandlerTerminate) - - go func() { - defer close(ctxHandlerDone) - select { - case <-ctx.Done(): - c.Close() - case <-ctxHandlerTerminate: - } - }() - _, err = c.Options(u) if err != nil { c.Close() @@ -368,11 +348,6 @@ func (c *Client) DialReadContext(ctx context.Context, address string) error { // DialPublish connects to the address and starts publishing the tracks. func (c *Client) DialPublish(address string, tracks Tracks) error { - return c.DialPublishContext(context.Background(), address, tracks) -} - -// DialPublishContext connects to the address with the given context and starts publishing the tracks. -func (c *Client) DialPublishContext(ctx context.Context, address string, tracks Tracks) error { u, err := base.ParseURL(address) if err != nil { return err @@ -383,21 +358,6 @@ func (c *Client) DialPublishContext(ctx context.Context, address string, tracks return err } - ctxHandlerDone := make(chan struct{}) - defer func() { <-ctxHandlerDone }() - - ctxHandlerTerminate := make(chan struct{}) - defer close(ctxHandlerTerminate) - - go func() { - defer close(ctxHandlerDone) - select { - case <-ctx.Done(): - c.Close() - case <-ctxHandlerTerminate: - } - }() - _, err = c.Options(u) if err != nil { c.Close()