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

streamID not working #5

Closed
GintautasMickus opened this issue Aug 21, 2020 · 4 comments
Closed

streamID not working #5

GintautasMickus opened this issue Aug 21, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@GintautasMickus
Copy link

Hello,

I have tried your SRTWrapper for android seems to work except for streamID. I set it before making socket connection, but the reciever/listener does not get it... Any help would be appreciated.

@ThibaultBee
Copy link
Owner

Just to be sure we understand each other, what you are doing is something like this:

  • on client side: socket.setSockFlag(SockOpt.STREAMID, "Hello")
  • on client side: connect to server
  • on server side: onListen is trigger but streamId is empty
    Is this what you are doing?

Have you tried socket.getSockFlag(SockOpt.STREAMID) on your server receiving socket when connection has been accepted by server?

@GintautasMickus
Copy link
Author

GintautasMickus commented Aug 27, 2020

Client:
if (this.srtSocket.setSockFlag(SockOpt.STREAMID, "Hello") != 0) {
this.srtSocket.close();
Thread.currentThread().interrupt();
return;
//throw new Exception("Failed to set sock flag to Sender: ${Utils.getErrorMessage()}");
}
if (this.srtSocket.connect(url, port) != 0) {
this.srtSocket.close();
Thread.currentThread().interrupt();
return;
//throw new Exception("Failed to connect to $ip:$port: ${Utils.getErrorMessage()}");
}

Server:
hSock = srt_accept(listenfd, (struct sockaddr )&clientaddr, &addrlen);
int st = srt_getsockflag(hSock, SRTO_STREAMID, (void
) msg, &addrlen);

st = 0 (no error)
addlen=0 (no message received)

P.S.
also on Client side debuger console I see error:
E/SRTJniStructs: OptVal: unknown class java.lang.String

@ThibaultBee ThibaultBee self-assigned this Aug 27, 2020
@ThibaultBee ThibaultBee added the bug Something isn't working label Aug 27, 2020
@ThibaultBee
Copy link
Owner

Hey,

I just fixed it in https://github.com/ThibaultBee/SRTWrapper/tree/bugfix/setSockOpt
You can try to use the artifact from jitpack when build is completed:
dependencies { implementation 'com.github.ThibaultBee:SRTWrapper:bugfix~setSockOpt-0660d81bd0-1' }

If it is Ok with you, I will merge into master and create milestone 0.8.1.

@GintautasMickus
Copy link
Author

I checked and now it works, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants