openfresh / gosrt

Go SRT library with the net package like API.
MIT License
66 stars 16 forks source link

How to get stream id to pair with connection? #14

Closed ivanjaros closed 3 years ago

ivanjaros commented 3 years ago

There is the WithListenCallback option that allows me to do basic authentication before local socket is created, as presented in the example. But how do I pair the connection with the stream id along the way? The SRTConn does not have any information that would allow me to know which net.Conn is which user/stream and the aforementioned callback does not have the connection available as argument since it has not been established yet.

thmatuza commented 3 years ago

You can access StreamID() on SRTConn https://github.com/openfresh/gosrt/blob/master/srt/example_test.go#L36

ivanjaros commented 3 years ago

ah, ok, i see. goland didn't show me the methods in "structure" because conn is not exported. i had to type cast it and then intellisense showed the method. lol.