Forum OpenACS Q&A: Response to tcllib nntp

Collapse
6: Response to tcllib nntp (response to 1)
Posted by Dan Wickstrom on
Yes my mistake.  Lately I've been doing some work on nsjava where I use the errorCode to store an exception object when an error occurs.  It appears that the errorCode is not cleaned up until the thread exits and deallocates the interpreter.  However for global variables in general, the interpreter cleans those up when the connection is closed.  In addition, all channels (sockets, files, etc) are also closed when the connection is closed, so it doesn't appear that there is a simple fix for your problem.

It seems that you need a separate thread, indpendent of the connections that you can use to service your news connection, so I would try putting your news service in its own thread using "ns_thread begindetached".  You could then use nsv_sets and mutexs to send data to/from the detached thread and synchronize access.  This approach is a bit more complicated, but having the news service in its own thread should allow you to have a single news handle and reuse it by proxy from the various connection threads.