Hi Mark, Unfortunately there is no easy way to do this currently. Your best bet is to not use the TcpPipelineHandler directly but derive your own instead that switches the pipelines when you want them -- you can use the code of TcpPipelineHandler as a starting point.
There is one other tricky issue you have to be aware of. Since you parse Strings at the beginning you probably use DelimiterFraming or something similar. This stage might have parts of the first chunk of the binary stream that follows and there is currently no way to extract that chunk. -Endre On Tue, Dec 31, 2013 at 1:01 AM, Mark Beeson <[email protected]> wrote: > In-depth Akka IO question coming up, be forewarned. > > I'm in the middle of creating an Akka IO-based SMTP server as a > replacement for the thread-based SubEthaSMTP. So far so good, except > there's a slight hitch which I've been pounding my head against. > > ESMTP allows for TLS connections, only these connections are only > negotiated *after* the initial insecure connection has been established. > The flow goes like this: > > - client opens connection to server > - server > client "220 servername ESMTP softwarename" > - client > server "STARTTLS" > - server > client "220 2.0.0 Ready to start TLS" > - client > server (Insert TLS handshake here) > - (...normal TLS-encrypted SMTP transaction...) > - client closes connection to server > > My hangup is that I appear to be unable to *re-register* a different > pipeline for the connection once it hits the STARTTLS phase. I've thought > about creating a child of the current handler actor to take care of the TLS > traffic, but that doesn't appear to work either. > > Q: Is this even possible? Can I switch pipelines on the fly based on a > message? Can I just change the underlying socket for the current pipeline? > > Thanks! --Mark > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: http://akka.io/faq/ > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/groups/opt_out. > -- Akka Team Typesafe - The software stack for applications that scale Blog: letitcrash.com Twitter: @akkateam -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/groups/opt_out.
