Code Comments
Programming Forum and web based access to our favorite programming groups.This is what i do, if i know the server and the port:
########################################
############
####
########################################
############
proc ip {} {
#Trace
set me [socket -server garbage_word -myaddr [info hostname] 0]
set ip [lindex [fconfigure $me -sockname] 0]
close $me
return $ip
}
if it fails to return the ip, its DEAD !
"Tillmann Basien" <tab@basien n0spam.de> wrote in message
news:2tt01jF234vr1U1@uni-berlin.de...
> Hy,
> does anybody has a good and simple method to check a server?
> Here is what I do, but what`s not good.
>
> set alive 1; if [catch {exec ping -c 2 $name >& /dev/null}] { set alive
0 }
>
> I want to use this on linux and solaris.
>
> regard
> tab
>
>
Post Follow-up to this messagePossibly good to check, that my local host has an ip.
Whats about checking the avalibility of a destination ip.
ex:
socket destName 0
Is this a good way to try to open port 0 on destName
Posibily resulats are:
couldn't open socket: host is unreachable
couldn't open socket: connection refused
or a valid sock-Discriptor if there is a service 0
Other suggestions ?
"Mel" <mel.m.heravi@hp.com> schrieb im Newsbeitrag
news:4179533c$1@usenet01.boi.hp.com...
> This is what i do, if i know the server and the port:
>
> ########################################
############
> ####
> ########################################
############
> proc ip {} {
> #Trace
>
> set me [socket -server garbage_word -myaddr [info hostname] 0]
> set ip [lindex [fconfigure $me -sockname] 0]
> close $me
> return $ip
> }
>
> if it fails to return the ip, its DEAD !
>
> "Tillmann Basien" <tab@basien n0spam.de> wrote in message
> news:2tt01jF234vr1U1@uni-berlin.de...
> 0 }
>
>
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.