Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
AcidGuy #1
coldfusion Ping
hi guys!
i am developing an application for the company i work and the problem is the
next :
i am currently developing a flash based client that acceses to a ftp server
and the extract some files from 1 directory that contains many txt, then i get
the that info into flash so i can select 1 determined text file in the ftp and
read it into flash
the problem comes when i want to know if the remote host is connected to give
them support, the remote hosts are stores that get connected by dialing a
number to connect to the internet, so making ping is a vital part of the
application being created
is there a way or a tag to do this, i have right now coldfusion 6.1 developer
edition
thx for any help!
AcidGuy Guest
-
ping
Hi all, How can i do a simple ping with asp.net, returning only the time of the ping??? Thanks in advance, Fabio -
ttl value when ping...
Hi there, When I ping, for example www.cjman.com it returns a ttl value of 119. If I ping www.gallaudet.edu, it returns a value of 50. I have... -
Net::Ping
Using this module to test SMTP (port 25) connections, I want to close the connection gracefully instaed of simply closing the connection. Is there... -
IP ping
I have some programs that connect to servers, etc. that time out after non use for 20 minutes or so. If there some program I can load or use... -
can't ping lan
Hi I'm trying to set up IP masquerading. I had it set up under a previous install, but I can't get it going now. The problem seems to be related... -
JonathanBigelow #2
Re: coldfusion Ping
You could probably do something like this:
<cftry>
<cfexecute name="ping.exe" arguments="ftp.whatever.com"
timeout="5"></cfexecute>
<cfcatch type="Any">
Ping failed
</cfcatch>
</cftry>
JonathanBigelow Guest
-
AcidGuy #3
Re: coldfusion Ping
this worked perfectly but the informartion returned is poor or none at the end
of the 5 seconds transaction,
just return something when the operation has failed and a null when the
operation or the ping has been estabilished, is there a way to get more details
?
thx in advanced !
AcidGuy Guest
-
PaulH #4
Re: coldfusion Ping
if it doesn't need to be ping, you might look at java sockets (i'm at home,
i'll see if i can post better code when i get to the office tomorrow). this is
from memory:
<cfscript>
try {
socket=CreateObject("java", "java.net.Socket");
hostIP=javacast("string", "10.10.10.10"); // your remote host goes here
dayTimePort=javacast("int", 13);
socket.init(hostIP, dayTimePort);
socket.setSoTimeout(100);
ServerIP = socket.toString();
ServerPort = socket.getPort();
socket.close()
} // try
catch ("java.net.SocketException",e) {
socket.close();
}
</cfscript>
PaulH Guest
-
JonathanBigelow #5
Re: coldfusion Ping
What version of CF are you using? On 6.1 I get the following output with just
that code:
Pinging [url]www.yahoo.akadns.net[/url] [66.94.230.34] with 32 bytes of data:
Reply from 66.94.230.34: bytes=32 time=31ms TTL=51
Reply from 66.94.230.34: bytes=32 time=235ms TTL=51
Reply from 66.94.230.34: bytes=32 time=313ms TTL=51
Reply from 66.94.230.34: bytes=32 time=31ms TTL=51
Ping statistics for 66.94.230.34: Packets: Sent = 4, Received = 4, Lost = 0
(0% loss), Approximate round trip times in milli-seconds: Minimum = 31ms,
Maximum = 313ms, Average = 152ms
You should be able to parse through that pretty easily to clean up the results
if you like...
JonathanBigelow Guest
-
JonathanBigelow #6
Re: coldfusion Ping
Also you can speed it up a bit by using
<cfexecute arguments="www.yahoo.com -n 1"....></cfexecute>
which will only send 1 echo request.
JonathanBigelow Guest
-
AcidGuy #7
Re: coldfusion Ping
maybe the problem is in the server trying to send the vars to flash, what i see
is a big line of space ... , i will make function all those codes trying from
diferent ways tomorrow, now i have to go to university
thx for your support !
AcidGuy Guest
-
PaulH #8
Re: coldfusion Ping
just to keep my promise:
<cfscript>
try {
socket=CreateObject("java", "java.net.Socket");
readerObj=createObject("java","java.io.InputStream Reader");
bufferedObj=createObject("java","java.io.BufferedR eader");
hostIP=javacast("string", "10.10.10.10"); // your remote host goes here
dayTimePort=javacast("int", 13); // or some other port that is allowed on
their firewall/host
socket.init(hostIP, dayTimePort);
socket.setSoTimeout(1000); // some reasonable timeout value
inReader=readerObj.init(socket.getInputStream());
bReader=bufferedObj.init(inReader);
isAlive=true;
// check that box
tStamp=bReader.readLine();
ServerIP = socket.toString();
ServerPort = socket.getPort();
socket.close();
if (isAlive)
writeoutput("server #serverIP# (#serverPort#) is alive at #tStamp#");
} // try
catch ("java.net.SocketException" e) {
socket.close();
isAlive=false;
writeoutput("server #hostIP# (#dayTimePort#) is dead as a doorknob at
#now()#");
}
</cfscript>
PaulH Guest
-
AcidGuy #9
Re: coldfusion Ping
i think there is something missing in the code,
it gives me the next error with flash Remoting :
--------------------------------------------------------------------------------
---------------------
Service threw an exception during method invocation: Object Instantiation
Exception.
--------------------------------------------------------------------------------
---------------------
And with Coldfusion :
--------------------------------------------------------------------------------
---------------------
Object Instantiation Exception
--------------------------------------------------------------------------------
---------------------
AcidGuy Guest
-
-
CF_DAWG #11
Re: coldfusion Ping
Paul,
What is a good port to try this on for a server? I have tried
80,0,425,1089,1099,1505 and 9595. I still get the result back that the server
is "dead a a doorknob". Any help would be appreciated!
Thanks!
CF_DAWG Guest
-
PaulH #12
Re: coldfusion Ping
that port should work for the most part. port 80, etc. depends on what's
running on that host. and all of these (including doing a command line ping)
are controlled by firewalls, security, etc. i guess you might try one of the
ftp ports (20/21) since you seem to be doing ftp.
PaulH Guest



Reply With Quote

