-
Notifications
You must be signed in to change notification settings - Fork 44
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
Ping from a webserver #12
Comments
Yes, it's probably a socket conflict. I'm not sure what libraries you're
using for the HTTP server, but I would look there to see how it's
picking sockets. It's probably paving over the raw socket used for ICMP.
-Blake
FrankC2000 wrote:
…
Nice work here! Thanks!
My purpose is to build a little webserver in a box. I will put a led
outside to indicate the whether network is on (connected). So I ping
the gateway eache 5 secs to set the led.
The problem is, as soon as the server starts to receive HTTP requests,
it doesn't ping the gateway anymore, I mean does not receive SUCCESS
status. Could be a socket issue?
Any thoughts? Thanks in advance.
BTW, a changed pingSocket from 0 to 3 but it didn't work.
Keep up the good work!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#12>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AD-QzVSTcx8qhlg0aDZ_NyZ_wcdbcCmdks5sSziLgaJpZM4OnXEk>.
|
Thank you for your quick reply! Almost a ping ;) I extended the Ethernet/Webserver example that comes with the IDE. The library is Ethernet.h. I have no idea what to change there.
|
If I remember correctly, the Ethernet library automatically picks a
socket that is not in use. I would suggest initializing the ICMP socket
before doing anything else with the Ethernet, if you're not already. In
theory, the Ethernet library should detect that you're using that socket
and skip it (probably--I don't actually remember how it detects whether
a socket is being used). There are only 4 sockets, so your chances of
getting a conflict if you don't take steps to avoid one are high.
-Blake
FrankC2000 wrote:
…
Thank you for your quick reply! Almost a ping ;)
I extended the Ethernet/Webserver example that comes with the IDE. The
library is Ethernet.h. I have no idea what to change there.
* Frank
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD-QzfqyqiQftEUJlJr71lWY2r91eDEkks5sTHc-gaJpZM4OnXEk>.
|
What do you mean by initializing the ICMP socket? The very first call to the ICMPEchoReply.ping method? I call Ethernet.begin before the first call to the ICMPEchoReply.ping. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice work here! Thanks!
My purpose is to build a little webserver in a box. I will put a led outside to indicate the whether network is on (connected). So I ping the gateway eache 5 secs to set the led.
The problem is, as soon as the server starts to receive HTTP requests, it doesn't ping the gateway anymore, I mean does not receive SUCCESS status. Could be a socket issue?
Any thoughts? Thanks in advance.
BTW, a changed pingSocket from 0 to 3 but it didn't work.
Keep up the good work!
The text was updated successfully, but these errors were encountered: