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?

On Wednesday 27 November 2002 02:47 pm, (Via wrote:
> Yes, but you should be able to code it to push any conns into another
> thread and let the listener go back to listening. Tell us what your reqt is
> and we'll see if we can come up with a way to make it work.
>
> /s.
>
> -----------------------------------------------------------------------
> Scott S. Goodwin
> e: [EMAIL PROTECTED] | u: http://scottg.net
> aim: scottgnet
>
> ----- Original Message -----
> From: "David Walker" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 27, 2002 2:15 PM
> Subject: Re: [AOLSERVER] ns_socklistencallback
>
> > Thanks Scott.
> >
> > Guess I expected too much from this command.  Apparently it can only
>
> accept
>
> > one connection at a time.
> >
> > On Sunday 24 November 2002 01:50 pm, Scott S. Goodwin wrote:
> > > Here's a piece of test code I've used in the past:
> > >
> > > # This proc is run when a connection occurs
> > >
> > > proc handle_socklistencallback {rfd wfd} {
> > >     ns_log notice "A client has connected to the socket"
> > >     while {[set line [string trim [gets $rfd]]] != ""} {
> > >         lappend headers $line
> > >     }
> > >     ns_log notice "CLIENT HTTP HEADERS:"
> > >     ns_log notice "$headers"
> > >
> > >     set content_htm \
> > > "<html>
> > > <head>
> > > <title>non-ssl test</title>
> > > </head>
> > > <body>
> > > <p>Great! We were able to do a listen-callback on a socket,
> > > read the client HTTP header and send back this HTML page. Hit the back
> > > button to return to the test page.
> > > <p>Here ar the HTTP client headers you sent me:
> > > <p>$headers
> > > </body>
> > > </html>"
> > >
> > >     set myheader \
> > >         "HTTP/1.0 200 Document follows
> > > MIME-Version: 1.0
> > > Content-Type: text/html
> > > Content-Length: [string length $content_htm]"
> > >
> > >     puts $wfd \
> > > "$myheader
> > >
> > >
> > > $content_htm"
> > >
> > >     flush $wfd
> > >     close $rfd
> > >     close $wfd
> > > }
> > >
> > > # This starts the listener on an address and port, and tells it
> > > # what proc to run when a connection comes in
> > >
> > > ns_socklistencallback 192.168.0.2 8443 handle_socklistencallback
> > >
> > >
> > > /s.
> > >
> > > -----------------------------------------------------------------------
> > > Scott S. Goodwin
> > > e: [EMAIL PROTECTED] | u: http://scottg.net
> > > aim: scottgnet
> > >
> > >
> > > ----- Original Message -----
> > > From: "David Walker" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Sunday, November 24, 2002 10:23 AM
> > > Subject: [AOLSERVER] ns_socklistencallback
> > >
> > > > does anyone have any ns_socklistencallback sample code?

Reply via email to