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

srtcore/core.cpp@6491:sendmsg2 14:54:30.657568/Thread-60*E:SRT.as: INVALID: Data size for sending declared with length: 0 #28

Closed
wangpeng1 opened this issue Nov 22, 2022 · 5 comments

Comments

@wangpeng1
Copy link

i put the aar in my android java project, the connect is correct,but when i call send() method,it give me the error

@wangpeng1
Copy link
Author

Sometimes when i call send()method it give me: java.net.SocketTimeoutException: Connection setup failure: socket closed during operation.

@ThibaultBee
Copy link
Owner

Hi,
Could you share how you use send() (with the ByteBuffer or the ByteArray)?

About the second exception, it is explicit: the socket has been closed.

@wangpeng1
Copy link
Author

Hi,
in my java android project ,when,i used send(ByteBuffer) it give me java.net.SocketTimeoutException: Connection setup failure: socket closed during operation.
when i used send(ByteBuffer.array()) it give me Operation not supported: Incorrect use of Message API (sendmsg/recvmsg).

when i used srtSocket.getOutputStream(null).write(buffer.array()); it is ok.

but in your kotlin project,all is ok.

@wangpeng1
Copy link
Author

when i call send() method,then the socket been closed. Not socket been closed ,then call send() mistake. I test many times,and also see the server.

@ThibaultBee
Copy link
Owner

So, you don't face the first issue anymore?

I believe the only issue you face is that you are trying to use message API with an incorrect size of buffer. Either:

  • use a buffer with the correct size
  • use stream API
    Please refer to the SRT documentation for more info.

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