Hi.
Is there any PHP function that allows me to check if a device is still online?
I have one computer managing information (writing to a file) whilst another is using that information but i need the main computer to know if the other has lost its connection to the internet. Is there a way to check via the IP or something? Anything that writes to a database seems worthless since a lost connection wont trigger a change to the database.
Thought there might be some function that could check the IPs viewing a file or something?
Many thanks in advance
Checking if remote device is still online
Moderator: General Moderators
-
britishmonkey
- Forum Newbie
- Posts: 3
- Joined: Thu Mar 17, 2011 2:01 pm
Re: Checking if remote device is still online
Wow, that's so odd. Are you running like a database on one computer, and then using the other to run like php files or w.e?
-
britishmonkey
- Forum Newbie
- Posts: 3
- Joined: Thu Mar 17, 2011 2:01 pm
Re: Checking if remote device is still online
Hmm ..... odd? Simple really.
One computer writes data to a file. Other computer reads said data from file via php. Any way for the 1st computer to know if the computer reading the data is no longer online?
One computer writes data to a file. Other computer reads said data from file via php. Any way for the 1st computer to know if the computer reading the data is no longer online?
Re: Checking if remote device is still online
If the 2nd computer has a static IP, you could try to ping that IP.
Without knowing more, this seems like a bandaid fix, not a solution. If the network connectivity of the 2nd computer is that uncertain, you should fix that problem.
Without knowing more, this seems like a bandaid fix, not a solution. If the network connectivity of the 2nd computer is that uncertain, you should fix that problem.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
-
britishmonkey
- Forum Newbie
- Posts: 3
- Joined: Thu Mar 17, 2011 2:01 pm
Re: Checking if remote device is still online
Thx Pickle - will look for some PHP code that pings an IP.
The reliability of the other computer is irrelevant to this question. All I want is to know if PHP can check such a thing in the event it happens. Didn't think this question would give rise to so many other questions on here - either PHP has this capability or not, I would have thought.
The reliability of the other computer is irrelevant to this question. All I want is to know if PHP can check such a thing in the event it happens. Didn't think this question would give rise to so many other questions on here - either PHP has this capability or not, I would have thought.