TCL webstats module - connection problems

These are old archives. They are kept for historic purposes only.
Post Reply
pepolez
Posts: 9
Joined: Sun Oct 31, 2004 2:08 am
Location: Australia
Contact:

TCL webstats module - connection problems

Post by pepolez »

I have been trying to make a TCL module for UnrealIRCD that outputs stats to a webpage but in text only. Unfortunately, I have been unable to get the program to connect to the server due to ping timeouts and other connection problems. Since I have been trying to fix the connection problem, I haven't been working on the stats gathering or output part of the program, only the connection part. Does anyone know how i could improve/fix this code or exactly what is wrong with it. Remeber, this is a statndalone program, meant to be executed using the wish interpereter.

Code: Select all

## UnrealIRCD linking test ##
set server "10.0.10.37"
set port "7029"
set botnick "socktest"
set servername "sock.test"
set numeric 42
set serverdesc "Test socket server"
set domain "socktest.beta"
set botname "testsock"
set mychan "#SockeTCL"
set password "testsocket"
set sockchan [socket $server $port]
puts "Logging in..."
puts $sockchan "PROTOCTL VL"
puts $sockchan "PASS :$password"
puts $sockchan "SERVER $servername 1 :U0-*-$numeric $serverdesc"
set loopy 1
while {$loopy<4} {
gets $sockchan raw
set isping [lindex [split $raw] 1]
if {$isping == "PING"} {
	set pingreply [lindex [split $raw] end]
	puts $sockchan ":PONG $pingreply"
}
if {$isping == "ERROR"} {
puts "$isping"
puts "Error connecting, aborting"
} else {
puts "$raw"
}
incr loopy 1
}
puts "Introducing pseudoclient: $botnick..."
puts $sockchan "NICK $botnick 1 1077205492 $botnick $domain $servername 0 +oiSq $domain :$botname"
puts "Joining channel..."
puts $sockchan ":$botnick JOIN $mychan"

The server that is being linked to says this
--- *** Notice -- (link) Link Ph34rful.ImmorTalZ.org -> sock.test[@0:0:0:0:0:ffff:10.0.10.34.39052] established
--- *** Global -- Closing link: Write error: Connection reset by peer - sock.test[10.0.10.34]
The IRCD is located on the computer with the IP address 10.0.10.37 and the program I am developing is being executed on 10.0.10.34. Any ideas?
There are 10 types of people in the world, those who understand binary and those who don't.
codemastr
Former UnrealIRCd head coder
Posts: 811
Joined: Sat Mar 06, 2004 8:47 pm
Location: United States
Contact:

Post by codemastr »

1.) That's not a module, that's a separate program
2.) Unreal doesn't support TCL
3.) You'll need to read up on sockets in TCL.

This really isn't the place to get help with such things. Try a TCL support channel.
-- codemastr
pepolez
Posts: 9
Joined: Sun Oct 31, 2004 2:08 am
Location: Australia
Contact:

Post by pepolez »

codemastr wrote:1.) That's not a module, that's a separate program
.
pepolez wrote:Remeber, this is a statndalone program, meant to be executed using the wish interpereter.
lol, just thought id take a chance and see if anyone knew. thanks anyway :)
There are 10 types of people in the world, those who understand binary and those who don't.
Post Reply