This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Sat Jun 07, 2003 11:35 am
Some while ago i got this form you guys verry greatfull for it but everytime i get a pc with a lan ip like 192.168 witch is c class ip aswell , ...
it doesn't show the internet ip but the lan ip ...
Code: Select all
set s [socket -server "" -myaddr [info hostname] 0];
set ip [lindex [fconfigure $s -sockname] 0]
close $s
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Sat Jun 07, 2003 12:12 pm
Code: Select all
set sock [socket -async 1.2.3.4 5]
set ip [lindex [fconfigure $sock -sockname] 0]
close $sock
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Sat Jun 07, 2003 1:18 pm
result = ip 0.0.0.0
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Wed Jun 11, 2003 2:11 pm
I found this and it seems to work so if anyone else would like it ..
The var is $MyIP incase you shouldn't know
Code: Select all
set MyIP ""
foreach a {a b c d e f g h i j k} {
catch {
set external [socket $a.root-servers.net 53]
set MyIP [lindex [fconfigure $external -sockname] 0]
close $external
}
if { ![string equal $MyIP ""] } { break }
}