Page 1 of 1

TCL webstats module - connection problems

Posted: Sun Feb 13, 2005 8:38 am
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?

Posted: Sun Feb 13, 2005 5:09 pm
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.

Posted: Mon Feb 14, 2005 10:05 am
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 :)