Dossy,
This sounds like just the ticket. I actually am using AOLServer 4.5,
coincidentally. I'm also happy to say that it compiles out of the box
on windows, which was not true of the last 4.x I tried (well, it was
some time ago)
So it looks like the nsproxy establishes a tcl interp that is persistent
between connections, and can be accessed (well, code can be sent to it,
results can be sent back) by any thread? Perfect!
I am going to take a shot at implementing it this afternoon. If I run
into trouble I will take you up on your offer.
Actually I can already think of a lot more uses of this. I've been
using AOLServer since back in the day when you could share file handles
between threads. This made logging much simpler because you could
initialize logs on server startup and write to them any time. When it
moved to multiple interps that did not share file handles, we had to
start doing stuff like queueing file writes to nsvs and flushing those
periodically, or opening a file EVERY TIME you wanted to write to it,
and wrapping that in mutexes. Either way, kind of a pain... This might
enable certain things like that again.
Just out of curiosity, what problem was nsproxy explicitly created to
solve? Just generic tidbits like this, or was there another force
behind it?
Rusty
Dossy Shiobara wrote:
On 2006.08.25, Rusty Brooks <[EMAIL PROTECTED]> wrote:
The deal is, I need to open a connection to a port on the same machine,
or another machine, and send commands back and forth. That part is easy
enough.
The connection needs to be persistent though, and ideally I would open
one connection that all threads in the server could use.
I would suggest upgrading to AOLserver 4.5.0 and looking at the newly
introduce nsproxy module. I'd create a proxy pool of size 1 and
establish the network connection in the proxy. Then, code running in
the server can grab the (one) handle to the proxy and use the socket
then release the handle, but as long as you don't kill/restart the
proxy, the connection will stay connected in the proxy.
There's a reason why everyone should be happy to upgrade to AOLserver
4.5.0, the nsproxy module makes it so worth it. :-)
Rusty, I'd be happy to help you write the code for the implementation of
this if you're willing to allow the code to be released with the
AOLserver license and used as an example for everyone else. Just let me
know if you're interested.
-- Dossy
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.