I am going to start developing a 4.5-based Usenet app, but I need some
help sorting out how to use the tcllib nntp object in the
AOLsever/OpenACS namespace.
For reference, I posted the tcllib nntp code to:
http://jamesthornton.com/try/nntp.tcl.txt
-- I placed this in my shared Tcl library.
If I place the following in a standard Tcl page, I can query the
newsgroup, buy only once.
set NH [::nntp::nntp "" "" news_handle]
$NH authinfo "username" "password"
set list [$NH listgroup "comp.lang.tcl"]
foreach msgid $list {
append articles [$NH article $msgid]
}
Immediately reloading the page causes an error (it works again if
you wait a while)....
[01/Jul/2002:10:28:59][1294.103429][-conn4-] Error: command
"news_handle" already exists, unable to create nntp connection
command "news_handle" already exists, unable to create nntp connection
while executing
"error "command "$name" already exists, unable to create nntp
connection""
(procedure "::nntp::nntp" line 20)
invoked from within
"::nntp::nntp "" "" news_handle"
invoked from within
"set NH [::nntp::nntp "" "" news_handle]"
(file "/web/james/www/try/nntp.tcl" line 10)
invoked from within
"source $ad_conn(file)"
(procedure "ad_handle_abstract_url" line 67)
invoked from within
"ad_handle_abstract_url cns29 {}"
Putting the creation of the nntp object in a shared proc (as a
nsv_set), causes this error when you load the page...
[01/Jul/2002:09:16:55][1193.4101][-conn0-] Error: can not find channel
named "sock13"
can not find channel named "sock13"
while executing
"puts $sock "$cmd""
(procedure "::nntp::cmd" line 9)
invoked from within
"::nntp::cmd news_handle {AUTHINFO USER username}"
("eval" body line 1)
invoked from within
"eval [list ::nntp::cmd $name] $args"
(procedure "::nntp::command" line 2)
invoked from within
"::nntp::command $name "AUTHINFO USER $user""
(procedure "::nntp::_authinfo" line 5)
invoked from within
"::nntp::_authinfo news_handle username password"
("eval" body line 1)
invoked from within
"eval [list ::nntp::_$cmd $name] $args"
(procedure "::nntp::NntpProc" line 20)
invoked from within
"$NH authinfo "username" "password""
(file "/web/james/www/try/nntp.tcl" line 11)
invoked from within
"source $ad_conn(file)"
(procedure "ad_handle_abstract_url" line 67)
invoked from within
"ad_handle_abstract_url cns1 {}"