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

android can not recieve message #251

Closed
shiliupingGitHub opened this issue Nov 16, 2020 · 17 comments
Closed

android can not recieve message #251

shiliupingGitHub opened this issue Nov 16, 2020 · 17 comments

Comments

@shiliupingGitHub
Copy link

I make a dll for unity3d , It works fine on windows , But Not ok on android . the url is "wss://xxxx:“。 ” , I track the code, final I get the error in the "IXNetSystem.cpp" ::poll(fds, nfds, timeout); the function always return -1 and the errorno is alaways 4. how can I fixed , forgive my pool english

@shiliupingGitHub
Copy link
Author

ndk version is 21b

@bsergean
Copy link
Collaborator

bsergean commented Nov 16, 2020 via email

@shiliupingGitHub
Copy link
Author

I set cafile = NONE , It works well on windows. on android It looks like the function "poll" does not work. it always return -1. maybe ndk problem?

@shiliupingGitHub
Copy link
Author

just work for the client side

@bsergean
Copy link
Collaborator

bsergean commented Nov 16, 2020 via email

@shiliupingGitHub
Copy link
Author

yes , errorno value is 4, It means system call interrupt . I don't know why . I just guess it was ndk problem

@bsergean
Copy link
Collaborator

bsergean commented Nov 16, 2020 via email

@shiliupingGitHub
Copy link
Author

and also In your code , if the return value is -1, you will close the socket

@bsergean
Copy link
Collaborator

bsergean commented Nov 16, 2020 via email

@shiliupingGitHub
Copy link
Author

emm ,I makes a loop to wrap this , it looks like return -1 forever . so what version ndk have you tested before

@bsergean
Copy link
Collaborator

bsergean commented Nov 16, 2020 via email

@bsergean
Copy link
Collaborator

bsergean commented Nov 16, 2020 via email

@bsergean
Copy link
Collaborator

@tiwariashish86 would know better about ndk versions ... Hi Ashish !

@shiliupingGitHub
Copy link
Author

emm . I will use another vesion ndk to test. thank you very much

@shiliupingGitHub
Copy link
Author

int ret = -1;

  •    do
    
  •    {
    
  •        ret = ::poll(fds, nfds, timeout);
    
  •    }
    
  •    while (ret == -1 && errno == EINTR)
    
  •    return ret;
    

I have tested , this code solve my problem , thx

@bsergean
Copy link
Collaborator

Great. I have released that fix in the latest version of the library.

@bsergean
Copy link
Collaborator

v11.0.4

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