Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-21 Thread Juha Laiho

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



Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-20 Thread Ronald Klop
On Fri, 20 Nov 2009 07:13:44 +0100, Karthik Nanjangude  
karthik.nanjang...@xius-bcgi.com wrote:



Hi

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  :(


Tomcat is a Servlet engine. You can use Tomcat to write/run Servlets.

What is your setup?

client -A- tomcat -B- 3rd party app?

'A' is handled by a servlet?
And you have to write 'B'?

Can you provide more information?

Ronald.




With regards
KArthik

-Original Message-
From: Ronald Klop [mailto:ronald-mailingl...@base.nl]
Sent: Thursday, November 19, 2009 9:06 PM
To: Tomcat Users List
Subject: Re: Howto Socket (TCP / IP ) reading from a war application on  
Tomcat


On Thu, 19 Nov 2009 14:59:16 +0100, Karthik Nanjangude
karthik.nanjang...@xius-bcgi.com wrote:


Hi

Can some body  provide me a sample code for  Socket  (TCP / IP )
reading  from a war application on Tomcat

Can Listeners be made use of for the same?

Reason:  I need to   Accept / Reply  a XML File over the socket port
from 3rd party application (as Client )
 Also the  Soap (Approached was not recommended for
this  existing application )



With regards
Karthik


See here for some examples:
http://tinyurl.com/ylq2zlj



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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



Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-20 Thread Pid

On 20/11/2009 06:13, Karthik Nanjangude wrote:

Hi

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  :(


You mentioned XML - use some existing library that works with XML.

Why are you determined to use a Socket?  You're making an HTTP 
connection, if you must do it the hard way, use an appropriate class, 
e.g. HttpURLConnection.


 http://lmgtfy.com/?q=java+Socket
 http://lmgtfy.com/?q=java+HttpURLConnection


You're not asking questions that anyone here is likely to want to help 
you with because:


1. You are not having a problem with a Tomcat installation.
2. You are not being specific about what the real issue is.
3. You are not stating what you've tried.
4. People get paid to write code and solve this type of problem.


You've posted on this list before and received help, no?
You've read this before, yes?

 http://catb.org/~esr/faqs/smart-questions.html



p




With regards
KArthik

-Original Message-
From: Ronald Klop [mailto:ronald-mailingl...@base.nl]
Sent: Thursday, November 19, 2009 9:06 PM
To: Tomcat Users List
Subject: Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

On Thu, 19 Nov 2009 14:59:16 +0100, Karthik Nanjangude
karthik.nanjang...@xius-bcgi.com  wrote:


Hi

Can some body  provide me a sample code for  Socket  (TCP / IP )
reading  from a war application on Tomcat

Can Listeners be made use of for the same?

Reason:  I need to   Accept / Reply  a XML File over the socket port
from 3rd party application (as Client )
  Also the  Soap (Approached was not recommended for
this  existing application )



With regards
Karthik


See here for some examples:
http://tinyurl.com/ylq2zlj

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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


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




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



RE: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-20 Thread Karthik Nanjangude
Hi

 You mentioned XML - use some existing library that works with XML.

A 3rd party Client S/w of C++ sends an XML string over socket

This socket is be defined and read by *Process* of web application



You are not having a problem with a Tomcat installation.

TOMCAT 6.0.2.0
JDK 1.6.0
O/s  Linux / Unix / Windows


 Why are you determined to use a Socket?
Soap over HTTP (Approached was not recommended by the existing client s/w


You are not stating what you've tried.
With a Load on Startup servlet tried to listen to the socket,which does not work


 People get paid to write code and solve this type of problem
I have been using this form since 2000 (almost 10 years) and have giving 
solutions /ideas to not so smart guys like me
This form was created for the same cause, I presume not to make money :(




With regards
Karthik

-Original Message-
From: Pid [mailto:p...@pidster.com]
Sent: Friday, November 20, 2009 3:34 PM
To: users@tomcat.apache.org
Subject: Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

On 20/11/2009 06:13, Karthik Nanjangude wrote:
 Hi

 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  :(

You mentioned XML - use some existing library that works with XML.

Why are you determined to use a Socket?  You're making an HTTP
connection, if you must do it the hard way, use an appropriate class,
e.g. HttpURLConnection.

  http://lmgtfy.com/?q=java+Socket
  http://lmgtfy.com/?q=java+HttpURLConnection


You're not asking questions that anyone here is likely to want to help
you with because:

1. You are not having a problem with a Tomcat installation.
2. You are not being specific about what the real issue is.
3. You are not stating what you've tried.
4. People get paid to write code and solve this type of problem.


You've posted on this list before and received help, no?
You've read this before, yes?

  http://catb.org/~esr/faqs/smart-questions.html



p



 With regards
 KArthik

 -Original Message-
 From: Ronald Klop [mailto:ronald-mailingl...@base.nl]
 Sent: Thursday, November 19, 2009 9:06 PM
 To: Tomcat Users List
 Subject: Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

 On Thu, 19 Nov 2009 14:59:16 +0100, Karthik Nanjangude
 karthik.nanjang...@xius-bcgi.com  wrote:

 Hi

 Can some body  provide me a sample code for  Socket  (TCP / IP )
 reading  from a war application on Tomcat

 Can Listeners be made use of for the same?

 Reason:  I need to   Accept / Reply  a XML File over the socket port
 from 3rd party application (as Client )
   Also the  Soap (Approached was not recommended for
 this  existing application )



 With regards
 Karthik

 See here for some examples:
 http://tinyurl.com/ylq2zlj

 --
 Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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


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



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


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



Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-20 Thread Peter Crowther
2009/11/20 Karthik Nanjangude karthik.nanjang...@xius-bcgi.com

 A 3rd party Client S/w of C++ sends an XML string over socket

 This socket is be defined and read by *Process* of web application

 OK, so you're trying to get Tomcat to do something it's not designed to do:
handle incoming TCP connections that are not HTTP connections.  This will be
a lot of work.  It's like trying to drive a car along a river instead of a
road... sure, you can adapt the car to do that, but it might be cheaper to
get a boat!  In this case, it might be cheaper to get a socket server.

What are the goals for performance and response time to the C++ client?  Can
you use something like Apache MINA (http://mina.apache.org/) to write
yourself a small server that accepts the incoming XML from the C++ client,
then wraps it in a HTTP request and sends that HTTP request to Tomcat?

- Peter


Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-20 Thread Ronald Klop
On Fri, 20 Nov 2009 13:20:04 +0100, Karthik Nanjangude  
karthik.nanjang...@xius-bcgi.com wrote:



Hi


You mentioned XML - use some existing library that works with XML.


A 3rd party Client S/w of C++ sends an XML string over socket

This socket is be defined and read by *Process* of web application




You are not having a problem with a Tomcat installation.


TOMCAT 6.0.2.0
JDK 1.6.0
O/s  Linux / Unix / Windows



Why are you determined to use a Socket?

Soap over HTTP (Approached was not recommended by the existing client s/w



You are not stating what you've tried.
With a Load on Startup servlet tried to listen to the socket,which does  
not work


What went wrong? There is no reason why such a thing should not work. Just  
instantiate a static class/Thread which listens on a port. I don't  
understand your problem. It is the same as a standalone program except you  
are starting your class differently.


Ronald.







People get paid to write code and solve this type of problem
I have been using this form since 2000 (almost 10 years) and have giving  
solutions /ideas to not so smart guys like me

This form was created for the same cause, I presume not to make money :(




With regards
Karthik

-Original Message-
From: Pid [mailto:p...@pidster.com]
Sent: Friday, November 20, 2009 3:34 PM
To: users@tomcat.apache.org
Subject: Re: Howto Socket (TCP / IP ) reading from a war application on  
Tomcat


On 20/11/2009 06:13, Karthik Nanjangude wrote:

Hi

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  :(


You mentioned XML - use some existing library that works with XML.

Why are you determined to use a Socket?  You're making an HTTP
connection, if you must do it the hard way, use an appropriate class,
e.g. HttpURLConnection.

  http://lmgtfy.com/?q=java+Socket
  http://lmgtfy.com/?q=java+HttpURLConnection


You're not asking questions that anyone here is likely to want to help
you with because:

1. You are not having a problem with a Tomcat installation.
2. You are not being specific about what the real issue is.
3. You are not stating what you've tried.
4. People get paid to write code and solve this type of problem.


You've posted on this list before and received help, no?
You've read this before, yes?

  http://catb.org/~esr/faqs/smart-questions.html



p




With regards
KArthik

-Original Message-
From: Ronald Klop [mailto:ronald-mailingl...@base.nl]
Sent: Thursday, November 19, 2009 9:06 PM
To: Tomcat Users List
Subject: Re: Howto Socket (TCP / IP ) reading from a war application on  
Tomcat


On Thu, 19 Nov 2009 14:59:16 +0100, Karthik Nanjangude
karthik.nanjang...@xius-bcgi.com  wrote:


Hi

Can some body  provide me a sample code for  Socket  (TCP / IP )
reading  from a war application on Tomcat

Can Listeners be made use of for the same?

Reason:  I need to   Accept / Reply  a XML File over the socket port
from 3rd party application (as Client )
  Also the  Soap (Approached was not recommended for
this  existing application )



With regards
Karthik


See here for some examples:
http://tinyurl.com/ylq2zlj

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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


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




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


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




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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



Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-20 Thread André Warnier

Ronald Klop wrote:
On Fri, 20 Nov 2009 13:20:04 +0100, Karthik Nanjangude 
karthik.nanjang...@xius-bcgi.com wrote:



Hi


You mentioned XML - use some existing library that works with XML.


A 3rd party Client S/w of C++ sends an XML string over socket

This socket is be defined and read by *Process* of web application




You are not having a problem with a Tomcat installation.


TOMCAT 6.0.2.0
JDK 1.6.0
O/s  Linux / Unix / Windows



Why are you determined to use a Socket?

Soap over HTTP (Approached was not recommended by the existing client s/w



You are not stating what you've tried.
With a Load on Startup servlet tried to listen to the socket,which 
does not work


What went wrong? There is no reason why such a thing should not work. 
Just instantiate a static class/Thread which listens on a port. I don't 
understand your problem. It is the same as a standalone program except 
you are starting your class differently.



Just jumping in here for a minute..
Isn't there some fundamental logical problem here ?
Unless I am mistaken, we are talking about a webapp running under 
Tomcat.  This webapp is being run when there is a request (in principle, 
a HTTP request) received by Tomcat, whose URL matches one that the 
webapp is mapped to.
Now if that webapp gets started, somehow, and even if it starts 
listening on a socket (separate from the Tomcat Connector listening 
sockets), isn't that socket not going to be listening anymore when that 
webapp, somehow, stops running ?
I fail to see the inherent logic in running something like this under 
Tomcat.  I mean, even if somehow it works, what is the benefit of 
running this under a servlet engine ?

Should this not be instead a stand-alone application ?

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



Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-20 Thread Ronald Klop

On Fri, 20 Nov 2009 14:22:57 +0100, André Warnier a...@ice-sa.com wrote:


Ronald Klop wrote:
On Fri, 20 Nov 2009 13:20:04 +0100, Karthik Nanjangude  
karthik.nanjang...@xius-bcgi.com wrote:



Hi


You mentioned XML - use some existing library that works with XML.


A 3rd party Client S/w of C++ sends an XML string over socket

This socket is be defined and read by *Process* of web application




You are not having a problem with a Tomcat installation.


TOMCAT 6.0.2.0
JDK 1.6.0
O/s  Linux / Unix / Windows



Why are you determined to use a Socket?
Soap over HTTP (Approached was not recommended by the existing client  
s/w




You are not stating what you've tried.
With a Load on Startup servlet tried to listen to the socket,which  
does not work
 What went wrong? There is no reason why such a thing should not work.  
Just instantiate a static class/Thread which listens on a port. I don't  
understand your problem. It is the same as a standalone program except  
you are starting your class differently.



Just jumping in here for a minute..
Isn't there some fundamental logical problem here ?
Unless I am mistaken, we are talking about a webapp running under  
Tomcat.  This webapp is being run when there is a request (in principle,  
a HTTP request) received by Tomcat, whose URL matches one that the  
webapp is mapped to.
Now if that webapp gets started, somehow, and even if it starts  
listening on a socket (separate from the Tomcat Connector listening  
sockets), isn't that socket not going to be listening anymore when that  
webapp, somehow, stops running ?
I fail to see the inherent logic in running something like this under  
Tomcat.  I mean, even if somehow it works, what is the benefit of  
running this under a servlet engine ?

Should this not be instead a stand-alone application ?



That is something everybody except the OP is wondering about. :-)

Ronald.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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



Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-19 Thread Karthik Nanjangude
Hi

Can some body  provide me a sample code for  Socket  (TCP / IP ) reading  from 
a war application on Tomcat

Can Listeners be made use of for the same?

Reason:  I need to   Accept / Reply  a XML File over the socket port from 3rd 
party application (as Client )
 Also the  Soap (Approached was not recommended for this  
existing application )



With regards
Karthik


Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-19 Thread Pid

On 19/11/2009 13:59, Karthik Nanjangude wrote:

Hi

Can some body  provide me a sample code for  Socket  (TCP / IP ) reading  from 
a war application on Tomcat



Can Listeners be made use of for the same?

Reason:  I need to   Accept / Reply  a XML File over the socket port from 3rd 
party application (as Client )
  Also the  Soap (Approached was not recommended for this  
existing application )


You're asking us to write code for you?  For free?

p



With regards
Karthik




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



RE: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-19 Thread Karthik Nanjangude
Hi

Not necessary, if any can provide me some idea's

It would be wonderful


With regards
Karthik

-Original Message-
From: Pid [mailto:p...@pidster.com]
Sent: Thursday, November 19, 2009 7:36 PM
To: Tomcat Users List
Subject: Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

On 19/11/2009 13:59, Karthik Nanjangude wrote:
 Hi

 Can some body  provide me a sample code for  Socket  (TCP / IP ) reading  
 from a war application on Tomcat
 
 Can Listeners be made use of for the same?

 Reason:  I need to   Accept / Reply  a XML File over the socket port from 3rd 
 party application (as Client )
   Also the  Soap (Approached was not recommended for this  
 existing application )

You're asking us to write code for you?  For free?

p


 With regards
 Karthik



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


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



Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-19 Thread Ronald Klop
On Thu, 19 Nov 2009 14:59:16 +0100, Karthik Nanjangude  
karthik.nanjang...@xius-bcgi.com wrote:



Hi

Can some body  provide me a sample code for  Socket  (TCP / IP )  
reading  from a war application on Tomcat


Can Listeners be made use of for the same?

Reason:  I need to   Accept / Reply  a XML File over the socket port  
from 3rd party application (as Client )
 Also the  Soap (Approached was not recommended for  
this  existing application )




With regards
Karthik


See here for some examples:
http://tinyurl.com/ylq2zlj

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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



RE: Howto Socket (TCP / IP ) reading from a war application on Tomcat

2009-11-19 Thread Karthik Nanjangude
Hi

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  :(


With regards
KArthik

-Original Message-
From: Ronald Klop [mailto:ronald-mailingl...@base.nl]
Sent: Thursday, November 19, 2009 9:06 PM
To: Tomcat Users List
Subject: Re: Howto Socket (TCP / IP ) reading from a war application on Tomcat

On Thu, 19 Nov 2009 14:59:16 +0100, Karthik Nanjangude
karthik.nanjang...@xius-bcgi.com wrote:

 Hi

 Can some body  provide me a sample code for  Socket  (TCP / IP )
 reading  from a war application on Tomcat

 Can Listeners be made use of for the same?

 Reason:  I need to   Accept / Reply  a XML File over the socket port
 from 3rd party application (as Client )
  Also the  Soap (Approached was not recommended for
 this  existing application )



 With regards
 Karthik

See here for some examples:
http://tinyurl.com/ylq2zlj

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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


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