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

Rendezvous mode works only with outgoing connection #18

Closed
IgorEsaul opened this issue May 29, 2021 · 6 comments
Closed

Rendezvous mode works only with outgoing connection #18

IgorEsaul opened this issue May 29, 2021 · 6 comments

Comments

@IgorEsaul
Copy link

Socket socket = new Socket();
socket.setSockFlag(SockOpt.TRANSTYPE, Transtype.LIVE);
socket.setSockFlag(SockOpt.PAYLOADSIZE, 1316);
socket.rendezVous("0.0.0.0", remotehost, 5000);

if I set remotehost a non existent ip, connection is not established
Caller and Listener modes work fine.
I use android apps Larix Player, Haivision Play, Haivision Play Pro
Thank you.

@ThibaultBee
Copy link
Owner

Hi,

Do you have something on your logcat? Any hint about the issue?

As a temporary workaround, according to SRT documentation (https://github.com/Haivision/srt/blob/master/docs/API/API-functions.md#srt_rendezvous), rendezVous is a shortcut for doing bind locally, setting the SRTO_RENDEZVOUS option to true, and doing srt_connect..

It might be time to add an AndroidTest on rendezVous() to check what it's happening.

Regards,

@IgorEsaul
Copy link
Author

IgorEsaul commented May 30, 2021

socket.setSockFlag(SockOpt.RENDEZVOUS, true);
before rendezVous no success

logcat after 30 seconds of calling rendezVous
java.net.SocketException: Connection setup failure: connection timed out
at com.github.thibaultbee.srtdroid.models.Socket.rendezVous(Socket.kt:286)
at com.github.thibaultbee.srtdroid.models.Socket.rendezVous(Socket.kt:299)

i tried using "0.0.0.0", "localhost", "192.168.1.244" as the localhost value, no result
but
socket.bind(localhost, port);
socket.listen(10);
Pair<Socket, InetSocketAddress> pair = socket.accept();
it works well

a shortcut for doing bind locally, setting the SRTO_RENDEZVOUS option to true, and doing srt_connect..

I do not understand this phrase, rendezVous blocks the thread on 30 sec.

@ThibaultBee
Copy link
Owner

i tried using "0.0.0.0", "localhost", "192.168.1.244" as the localhost value, no result
but
socket.bind(localhost, port);
socket.listen(10);
Pair<Socket, InetSocketAddress> pair = socket.accept();
it works well

What operations do you perform on the peer device? I am not familiar with rendezVous API but the peer device should also call rendezVous.

a shortcut for doing bind locally, setting the SRTO_RENDEZVOUS option to true, and doing srt_connect..

I do not understand this phrase, rendezVous blocks the thread on 30 sec.

I think it means that:

socket.rendezVous("0.0.0.0", remotehost, 5000);

is the equivalent of:

socket.bind("0.0.0.0", 5000)
socket.setSockFlag(SockOpt.RENDEZVOUS, true)
socket.connect(remotehost, 5000).

@IgorEsaul
Copy link
Author

IgorEsaul commented May 30, 2021

I use android apps Larix Player, Haivision Play, Haivision Play Pro on another device as peers
all these apps in the Rendezvous mode accept only incoming connections.
I tried ffplay Rendezvous mode does not work at all.

socket.bind("0.0.0.0", 5000)
socket.setSockFlag(SockOpt.RENDEZVOUS, true)
socket.connect(remotehost, 5000).
it works(if remotehost is valid), but
socket.bind("0.0.0.0", 5000);
socket.setSockFlag(SockOpt.RENDEZVOUS, true);
socket.listen(10);
socket.accept();
java.net.SocketException: Operation not supported: Listen/accept is not supported in rendezous connection setup

@IgorEsaul
Copy link
Author

IgorEsaul commented May 30, 2021

In the link Larix Player - Larix Brodcaster if an incorrect ip address is specified in one of the apps, the connection is not established, a similar situation srtdroid - srtdroid.
conclusion: rendezVous accepts incoming connections only from remotehost addresses, I think this is not right, the address of the incoming connection can be different from the destination address of the outgoing connection.
Thanks

@ThibaultBee
Copy link
Owner

Hi,

I am not sure I fully understand the issue. It seems to me that you are describing the server/listener mode instead of the rendezvous mode.
Anyway, for SRT issue, you may want to contact them directly.

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