On May 4, 2006, at 1:53 AM, Frederic Soulier wrote:
I need to process (discard) Http headers to get to the binary payload (the interesting part). Has anyone dealt with something like that before within the MINA framework? What would be the best way to tackle that?My first idea was to keep using the same CumulativeProtocolDecoder I'm using now and add processing to filter out the Http header.
You might be able to use code from Asyncweb, a HTTP server built upon MINA, http://asyncweb.safehaus.org/ .. It already has stuff for parsing the HTTP headers. Of course, if you just want to skip them and not process them, doing it yourself would probably be easier.
I'd probably implement it as an IoFilter that watched messages for the indicator that the headers were done, not passing on messages to further filters until that condition was met. You could then store state in the IoSession to know that the condition has been met, so the filter then just passes data though.
Also right now we're listening on 1 port to accept client connections which could be clients using sockets to connect and/or Http. But someone suggested maybe to listen to 2 ports, one would take client connection for plain socket and one for Http. I'm not sure it will bring any benefits.
1 port is probably easier on your clients, but 2 is certainly easier for you.. With 1, you have to do extra work to determine if the connection is speaking HTTP or the other protocol, right? Its probably a wash as to which is better, up to you :)
-pete -- [EMAIL PROTECTED] - http://fotap.org/~osi
smime.p7s
Description: S/MIME cryptographic signature
