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

message recieved after 2-3 seconds delay #47

Closed
mozi22 opened this issue Apr 26, 2017 · 2 comments · Fixed by #56
Closed

message recieved after 2-3 seconds delay #47

mozi22 opened this issue Apr 26, 2017 · 2 comments · Fixed by #56

Comments

@mozi22
Copy link

mozi22 commented Apr 26, 2017

Hi,

Thanks for the awesome library. I am trying to use it in an application where I will be recieving a message each 50ms. Right now when I send a single packet, I recieve it after a 2-3 seconds delay. Is it the normal expected behavior ? If not, can I do something to make it faster ?

I am debugging it on an Google Nexus 9 tablet.

I am recieving a CANMessage using the busMaster software.

cristovao-trevisan added a commit to cristovao-trevisan/react-native-udp that referenced this issue Sep 26, 2017
This fixes tradle#47
The ´InetAddress.getHostName()´ blocks and does not resolve if there is no DNS server (example using an IOT device in AP mode, e.g. ESP8266), so I'm changing it to ´InetAddress.getHostAddress()´ as it is non-blocking.
@cristovao-trevisan
Copy link
Contributor

Hello, I was having the same error because hostname could not be resolved (blocking the receiving thread), as I have no DNS in my network (I'm using an IOT device, ESP8266, in AP mode). If you also don't have a DNS this should fix your problem

@cstranex
Copy link

I was having the same problem where my socket would freeze every so often for a couple seconds. So far it appears using @cristovao-trevisan's suggestion fixes the problem

mvayngrib pushed a commit that referenced this issue Jan 5, 2020
* Removing blocking function

This fixes #47
The ´InetAddress.getHostName()´ blocks and does not resolve if there is no DNS server (example using an IOT device in AP mode, e.g. ESP8266), so I'm changing it to ´InetAddress.getHostAddress()´ as it is non-blocking.

* Update for Android 7+
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

Successfully merging a pull request may close this issue.

3 participants