I like the ns_tcp and ns_udp ideas. I have the idea that since most protocols are about the same that I should be able to do about anything from aolserver/tcl
Here's my test so you can look it over. proc handle_socklistencallback {rfd wfd} { set headers {} puts $wfd {welcome} flush $wfd gets $rfd cmdline close $rfd close $wfd } ns_socklistencallback * 8443 handle_socklistencallback "telnet machinename 8443" from 2 different machines. The first one gets "welcome" The second one accepts the connection but doesn't get "wecome" until the first connection ends. On Wednesday 27 November 2002 05:59 pm, (Via wrote: > David Walker wrote: > >I want to support a reasonable number of concurrent connections. I am > > running a tcl based SMTP filter/server based on the smtpd in tcllib. I > > am converting it to run within AOLServer. > > > >Can ns_socklistencallback push the conn to another thread or will I have > > to use ns_socklisten, ns_sockaccept, and ns_thread? > > I thought that ns_socklistencallback provided a separate thread for each > connection, maybe that isn't true, but it should still be able to handle > multiple connections at the same time. Did you do testing that indicated > otherwise? > If you really need separate processing threads, I have used two > threadpools, using Rob Mayoff's dqd_threadpool module. One pool is for > worker threads, and one (with one thread) serialized access to a single > fd. You have multiple fds, so you probably don't need the second pool. > I hope, someday, we will have a module that generalizes the ns_conn > module: allowing optional url support, but not specific to the http > protocol. For lack of a better name I'm using ns_tcp and ns_udp. So the > day someone invents the next great protocol, AOLserver will be the > programming environment of choice. > > --Tom Jackson