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

Works on Simulator but not on Device #63

Open
alisomay opened this issue Feb 16, 2022 · 3 comments
Open

Works on Simulator but not on Device #63

alisomay opened this issue Feb 16, 2022 · 3 comments

Comments

@alisomay
Copy link

alisomay commented Feb 16, 2022

Do I need a special entitlement such as multicast to run this successfully in the device?

OSCServer(address: "", port: 5556) is running in the device.

Sender sends to device IP directly and port 5556.
This scenario works in the simulator but not in the actual device.

Thanks a lot for your help.

@alisomay
Copy link
Author

alisomay commented Feb 16, 2022

By checking further, I'm seeing that,

int len=(int)recvfrom(socket_fd, outdata, expted_len, 0, (struct sockaddr *)&cli_addr, &clilen);

in yudpsocket.c blocks on device.

I've changed the socket options a bit to introduce timeouts to at least have a return value by making recvfrom non blocking.

 struct timeval tv;
 tv.tv_sec = 3;
 tv.tv_usec = 750000;
 setsockopt( socketfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv) );

I'm receiving the return value of -1.

I'm almost sure that it should be related to some apple introduced security layer.

Have you ever tried running a server on the actual device?

Also in this test, to reduce the failure probability I'm going through this route

setsockopt( socketfd, SOL_SOCKET, SO_REUSEADDR, &reuseon, sizeof(reuseon) );

instead of this one,

setsockopt( socketfd, SOL_SOCKET, SO_BROADCAST, &reuseon, sizeof(reuseon) );

And running the server like

OSCServer(address: "127.0.0.1", port: 5556)

@devinroth
Copy link
Member

devinroth commented Feb 16, 2022 via email

@alisomay
Copy link
Author

If you have time, I'd love if you try again. It would be great help to me. Then I can know if it originates from me or the library.

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