Karthik Nanjangude wrote:
>> From: Ronald Klop [mailto:ronald-mailingl...@base.nl]
>>
>> On Thu, 19 Nov 2009 14:59:16 +0100, Karthik Nanjangude
>> <karthik.nanjang...@xius-bcgi.com> wrote:
>>>
>>> Can some body  provide me a sample code for  Socket  (TCP / IP )
>>> reading  from a war application on Tomcat
>>
>> See here for some examples:
>> http://tinyurl.com/ylq2zlj
>
This is not Fun dude...

I know how to write a SOCKET Programming for Standalone,

How do I write a socket Listener for WEB Application running over TOMCAT  when 
the application is up and running.?

Please be serious...I asked for some help or ideas .... :(

I would say the suggestion by Ronald was spot on. Tomcat will
happily handle HTTP over TCP sockets for you, but if you need
to work on TCP sockets without HTTP, then Tomcat will not be
of any help (or perhaps you could write your own listener class,
but that could be quite an undertaking).

So far you haven't told any reason for use of Tomcat at all,
perhaps there is one, but you're the only one of us who knows
about it.

If your scenario is that you have some data service which you
need to expose both over some custom XML over TCP implementation
and via HTTP, then perhaps your application structure should be
such that there is one application that handles the actual XML
data service (so provides the XML-over-TCP scenario), and would
then satisfy the needs of this third-party app. Then, to satisfy
the needs for the HTTP interface, you would write the requisite
servlet code to be run on Tomcat which would likewise get its
data using the same XML-over-TCP interface that the server already
provides.

Or perhaps you do it the other way around (esp. if you already
have the HTTP part running (and it is actually needed). You'll
write something that can accept the XML-over-TCP, and will make
the appropriate HTTP requests to get the required data from the
service already running on Tomcat.

If, however, the need is just for the XML-over-TCP solution, without
any HTTP interface needed now or in the foreseeable future, then
just drop Tomcat, and write the code that is needed. I trust there
are many good libraries and frameworks to help in building a good
custom socket server. Or then you can just write everything right
to the core Java APIs.
--
..Juha

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to