Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

srt.Dialer hangs, but other side receives connection. #16

Open
gissleh opened this issue Jan 28, 2021 · 1 comment
Open

srt.Dialer hangs, but other side receives connection. #16

gissleh opened this issue Jan 28, 2021 · 1 comment

Comments

@gissleh
Copy link

gissleh commented Jan 28, 2021

I'm using this library with libsrt 1.4.0, and listening works great, but dialing hangs when connecting to srt-live-transmit (tried both 1.4.0 and 1.4.2). The other side reports that the SRT source has connected, but dial will still time out.

The dialing part of the readme example also fails.

Is it caused by an incompatibility with libsrt 1.4, or is there an option with a bad default value?

@gissleh gissleh changed the title srt.Dialer hangs, other side receives connection. srt.Dialer hangs, but other side receives connection. Jan 28, 2021
@xmedia-systems
Copy link

xmedia-systems commented Mar 2, 2021

I'm facing the same issue, reproducible with the following test which deadlocks forever:

func TestDial(t *testing.T) {
	wg := sync.WaitGroup{}
	wg.Add(1)
	go func() {
		l, _ := srt.Listen("srt", ":5001")
		sc, _ := l.Accept()
		b := make([]byte, 1316)
		var err error
		for err == nil {
			_, err = sc.Read(b)
		}
		wg.Done()
		sc.Close()
		l.Close()
	}()
	wg.Add(1)
	go func() {
		tc, _ := srt.Dial("srt", "127.0.0.1:5001")
		b := make([]byte, 1316)
		tc.Write(b)
		tc.Close()
		wg.Done()
	}()
	wg.Wait()

}

seems like connect expects some data to be received immediately: https://github.com/openfresh/gosrt/blob/master/srt/fd_strapi.go#L121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants