>Jacque,
>
>Hopefully these will help...
>The following scripts work well for me in local one-machine tests. They
>require two stacks: a metacard "server" stack and the client stack. You will,
>of course, need to replace the "1.1.1.1" with your actual IP/domain name...
>
>In the server, I put:
>
>on openCard
>  accept connections on port 8080 with message gotOne
>end openCard
>
>on gotOne theSocket
>  write "OK" to socket theSocket
>  close socket theSocket
>end gotOne
>
>In the client:
>
>on openCard
>  checkOnline
>end openCard
>
>on checkOnline
>  open socket to "1.1.1.1:8080" with message gotcha
>  send "checkOnline" to this card in 10 seconds
>end checkOnline
>
>on gotcha s
>  read from socket s for 1 line
>  if (it = "OK") then put "Looks like we are online at"&&(the long time)
>  else answer "Looks like the server is not responding."
>  close socket s
>end gotcha
>
>on socketError
>  answer "Looks like we are offline."
>end socketError
>
>
>Regards,
>Brian

Optionally, if the client doesn't close the socket you can just do:
## after opening the socket and getting the file##
get hostAddress("1.1.1.1:8080") ## every 10 minutes
if it returns a number(local IP address) you are still connected to that
server, if it returns "not an open socket", you're not.

>
>Archives: http://www.mail-archive.com/metacard%40lists.best.com/
>Info: http://www.xworlds.com/metacard/mailinglist.htm
>Please send bug reports to <[EMAIL PROTECTED]>, not this list.


Regards, Andu



Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to