Hi Alexei,
>
> I have one small question - is it possible in Grizzly to support
> multiple
> protocols on the same port at the same time provided one of the
> protocols
> is supposed to be HTTP (and handled by Grizzly HTTP framework) and
> others
> are not (i.e. some binary protocols)? If it is possible then can
> anybody
> give some hints where to start?
Yep :)
> The reason I'm asking is that it seems that Grizzly NIO framework by
> itself
> can support various simultaneous protocols (though in its current
> form in a
> bit ugly way - it requires a tiny "proxy" ProtocolParser that
> detects the
> protocol upon connection initiation and internally creates and holds
> an
> instance of a "real" ProtocolParser), Grizzly HTTP framework also
> seems to
> have some support for implementation of various HTTP-style protocols
> on a
> single port BUT there is no clear way to integrate Grizzly NIO
> framework &
> Grizzly HTTP framework - the latter one doesn't use ProtocolParser and
> seems to hijack all regular NIO framework processing - it requires
> its own
> filter chain, its own working thread etc.
> The idea is to detect protocols and handle requests internally by
> the custom
> code unless the protocol is HTTP - in this case lets Grizzly
> HTTP/Servlet/Comet etc. engine do the job.
Grizzly has special filter, called PUReadFilter (port unification read
filter), where you can specify set of Protocol Finders[1] and
Handlers[2]
with HTTP and SelectorThread you don't need to add PUReadFilter
manually, but configure port unification directly on SelectorThread.
Please take a look at this test [3]- I've built simple example how
custom binary protocol can share same port with HTTP.
Please let me know if you have additional questions.
Thanks.
WBR,
Alexey.
[1]
https://grizzly.dev.java.net/source/browse/grizzly/trunk/modules/portunif/src/main/java/com/sun/grizzly/portunif/ProtocolFinder.java?rev=1076&view=markup
[2]
https://grizzly.dev.java.net/source/browse/grizzly/trunk/modules/portunif/src/main/java/com/sun/grizzly/portunif/ProtocolHandler.java?rev=1168&view=markup
[3]
https://grizzly.dev.java.net/source/browse/grizzly/trunk/modules/http/src/test/java/com/sun/grizzly/http/PortUnificationTest.java?rev=2351&view=markup
>
>
> Alexei
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>