RE: Can Tomcat be used to host socket servers?

2009-01-14 Thread Martin Gainty

In other words instead of committing to single port request TC use a port range 
for connector?
You might be able to accomplish the task by developing an algorithm which 
rewrites server.xml with 'unused port'
Not sure if this has been accomplished
?
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




 Date: Wed, 14 Jan 2009 09:20:27 -0500
 From: jhmast.develo...@gmail.com
 To: users@tomcat.apache.org
 Subject: Can Tomcat be used to host socket servers?
 
 Is it possible to use Tomcat to host socket servers? Or is Tomcat a strictly
 1 port operation?
 
 thanks

_
Windows Live™: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009

Re: Can Tomcat be used to host socket servers?

2009-01-14 Thread Jonathan Mast
Well what I want is to have a dedicated port for a socket, I just want all
the application infrastructure to be handled by Tomcat rather than a writing
a custom solution.  Not sure if dynamically rewriting server.xml is the way
to go.

My guess would by a Valve/Connector type thing, but I'm just not that
familiar with Tomcat.  I can't be only one who has had this issue.

The situation is that we have some existing programs (written in C) that are
socket servers.  I want to redo them in Java, and having Tomcat host them
would be great because I could focus solely on the parts of the program than
do request processing and leave the housekeeping to Tomcat.

In other words, I want to write servlets that are faux-sockets.

On Wed, Jan 14, 2009 at 10:33 AM, Martin Gainty mgai...@hotmail.com wrote:


 In other words instead of committing to single port request TC use a port
 range for connector?
 You might be able to accomplish the task by developing an algorithm which
 rewrites server.xml with 'unused port'
 Not sure if this has been accomplished
 ?
 Martin
 __
 Disclaimer and confidentiality note
 Everything in this e-mail and any attachments relates to the official
 business of Sender. This transmission is of a confidential nature and Sender
 does not endorse distribution to any party other than intended recipient.
 Sender does not necessarily endorse content contained within this
 transmission.




  Date: Wed, 14 Jan 2009 09:20:27 -0500
  From: jhmast.develo...@gmail.com
  To: users@tomcat.apache.org
  Subject: Can Tomcat be used to host socket servers?
 
  Is it possible to use Tomcat to host socket servers? Or is Tomcat a
 strictly
  1 port operation?
 
  thanks

 _
 Windows Live™: Keep your life in sync.
 http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009


RE: Can Tomcat be used to host socket servers?

2009-01-14 Thread Caldarale, Charles R
 From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
 Subject: Re: Can Tomcat be used to host socket servers?

 Not sure if dynamically rewriting server.xml is the way
 to go.

Pretty much guaranteed not to be, since that would require stopping and 
restarting Tomcat.

 The situation is that we have some existing programs
 (written in C) that are socket servers.

It's not clear to me exactly what you mean by are socket servers.  Do you 
mean they simply do a listen/accept on a server socket, waiting for connection 
requests from some client?  If so, what protocol is being used?  If it's not 
HTTP (or AJP), Tomcat won't help you.

Handling server sockets in Java borders on the trivial; using Tomcat just for 
that would be massive overkill.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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



Re: Can Tomcat be used to host socket servers?

2009-01-14 Thread Jonathan Mast
Thanks for cogent reply, Chuck :)

By socket servers, I mean the existing programs are bound to a particular
port number and just sit there waiting for requests.  The port numbers are
arbitrary, and I'm not knowledgeable enough of networking to know whether
they use HTTP or not.

I'll probably just write stand alone Java sockets servers and simply bounce
incoming requests over to a servlet I'll develop to do the heavy liffting.

The reason I would have liked Tomcat to handle the whole shebang is that now
I'll have to adjust each system that hosts these sockets to automatically
invoke them when they restart.  Kinda tedious.

Thanks again

On Wed, Jan 14, 2009 at 4:35 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
  Subject: Re: Can Tomcat be used to host socket servers?
 
  Not sure if dynamically rewriting server.xml is the way
  to go.

 Pretty much guaranteed not to be, since that would require stopping and
 restarting Tomcat.

  The situation is that we have some existing programs
  (written in C) that are socket servers.

 It's not clear to me exactly what you mean by are socket servers.  Do you
 mean they simply do a listen/accept on a server socket, waiting for
 connection requests from some client?  If so, what protocol is being used?
  If it's not HTTP (or AJP), Tomcat won't help you.

 Handling server sockets in Java borders on the trivial; using Tomcat just
 for that would be massive overkill.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you received
 this in error, please contact the sender and delete the e-mail and its
 attachments from all computers.

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




RE: Can Tomcat be used to host socket servers?

2009-01-14 Thread Caldarale, Charles R
 From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
 Subject: Re: Can Tomcat be used to host socket servers?

 By socket servers, I mean the existing programs are bound
 to a particular port number and just sit there waiting for
 requests.  The port numbers are arbitrary

How do they get assigned?  When you say the program is listening for a request, 
does it have a socket_read or socket_accept up?  (The first is looking for 
data, the second for a connection request.)

 I'm not knowledgeable enough of networking to know whether
 they use HTTP or not.

That's a rather critical factor to determine whether or not you can simply pass 
on the request to a servlet.

 The reason I would have liked Tomcat to handle the whole
 shebang is that now I'll have to adjust each system that
 hosts these sockets to automatically invoke them when they
 restart.  Kinda tedious.

You won't be able to use a stock Tomcat to listen/read on those ports, but you 
could still package your socket servers inside a webapp.  A 
ServletContextListener inside the webapp would likely have to create a thread 
for each port of interest, and those threads could connect with the standar 
Tomcat port to pass on HTTP-formatted requests.  Your clients would have to 
expect HTTP as a response, or your server threads would have to convert the 
response to whatever protocol the clients do expect.

You could also write your own Tomcat connector to do the above, rather than a 
webapp, but you would then be pretty much tied to a specific level of Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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