Git Product home page Git Product logo

Comments (4)

ThibaultBee avatar ThibaultBee commented on July 17, 2024

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?

from srtdroid.

GintautasMickus avatar GintautasMickus commented on July 17, 2024

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

from srtdroid.

ThibaultBee avatar ThibaultBee commented on July 17, 2024

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.

from srtdroid.

GintautasMickus avatar GintautasMickus commented on July 17, 2024

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

from srtdroid.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.