users@glassfish.java.net

Re: TCP server in GlassFish

From: Markus KARG <markus.karg_at_gmx.net>
Date: Sun, 13 Jan 2008 12:32:16 +0100

The following answer is not GlassFish specific but works on all Java EE
compliant server products.

If the protocol used is a typical C/S protocol (request - response) then
you can write a Servlet that implements the protocol. Especially HTTP
based transport is fairly easy that way. Otherwise you can write a JCA
complaint resource adapter that directly uses the Java IO or Java NIO
API to implement the protocol. In that case, using a framework like RAFC
or Grizzly makes work easier.

Both solutions are Java EE compliant and should work on Glassfish.

On the other hand I do ot see why you think that Web Services are doing
heavy polling. You can use JMS to push information to your client. That
also is Java EE compliant and works on Glassfish.

Regards
Markus

glassfish_at_javadesktop.org schrieb:
> Hi!
>
> I wish to develop an application where thick client would get information off the server and there would be 2 ways for them to communicate: over web services for clients behind too restrictive firewalls and over TCP for the rest. I would want to include TCP as an option to avoid the heavy polling the using of web services would cause.
>
> I'd like to do this with GlassFish because there are already applications deployed in it we use but I'm unable to find anything about writing TCP servers for J2EE.
>
> Is there a (nice) way to do this? Should I do this inside the container?
>
> Thanks
> [Message sent by forum member 'astoria45' (astoria45)]
>
> http://forums.java.net/jive/thread.jspa?messageID=253591
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>


-- 
http://www.xing.com/go/invita/58469