Forum OpenACS Development: socket connections

Collapse
Posted by Damien O'Rourke on
Are socket connections i.e. a socket connection that I create, persistent across procs? e.g. I create an ns_socket and get a write and a read channel. But if I pass the read channel to another proc and try to read from it it tells me it doesn't exist. Do I need to register a listener each tim eI enter the proc in order to read from it?

Cheers

Collapse
2: Re: socket connections (response to 1)
Posted by Andrew Piskorski on
I don't think procs are the problem, although I can't remember ever trying that. Maybe what's going on, is you're trying to pass sockets across threads, and that's why it's not working. I suspect sockets cannot normally be shared between threads. Give us more details about exactly what you're doing and what you're trying to accomplish.

FYI, I vaguely remember that either the latest version of Tcl (8.4.x), or some AOLserver add-on module (I forget which, maybe both) has some special magic by which you can pass sockets across threads. But that is not the default behaviour, if you really do need to do it, I think you have to do something special to invoke it.