Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: tclProcedure: Is Server Alive?
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
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Mel
10-23-04 01:57 AM


Re: tclProcedure: Is Server Alive?
Possibly 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 } 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Tillmann Basien
10-23-04 01:57 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:28 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.