Pulkit,
 This will be a brand new application.  We will be tracking a fleet of about
300 - 400 vehicles with modems in them which send out udp data.  We will
configure them to send to a port of our choosing.  I am planning to host a
java app on Tomcat to read this data, parse it and write to a database.  It
sounds like your question 3 below is correct.  I just want to get it
working, and my app happens to be deployed on Tomcat.  I guess I can monitor
the port without Tomcat needing to be configured differently.  That being
said, do you think my app with the main() method is the way to go, or should
I extend thread and make it threaded with a run() method?  Anyone see any
design flaws or opportunity for improvement?  As I said, most of my
experience thus far has been writing web applications that are called from
JSP's, so this is all new to me.

Thanks,
K

-----Original Message-----
From: Pulkit Singhal [mailto:[EMAIL PROTECTED]
Sent: Monday, December 26, 2005 2:27 PM
To: Tomcat Users List
Subject: Re: UDP Server app


Hi,

A few questions to help clarify what you want:

1) Is this UDP port actually being used by your instance of Tomcat for
implementing some functionality and you simply want to listen on the port
without interfering with the actions that take place? (kind of like a wire
tap)
--> If you are indeed trying to "monitor a port on Tomcat" then I take it
that Tomcat already makes use of that port of somehow. In which case, you
should really have no need to open anything or configure Tomcat in any way,
shape or form.

2) Are you looking to add-to Tomcat's present functionality on this UDP port
or extend it with
your code?
--> I lack ideas on this one.

3) This really has nothing to do with Tomcat in the sense that you just want
to listen on a UDP port and your app just happens to be deployed on Tomcat
and you just want the damned thing to work?
--> I think that if its simply an app that you deployed on Tomcat that will
listen on any given UDP port then Tomcat has no business constraining you.
But ofcourse this can be confirmed :)

If it was me...here's how I would go about confirming:
a) I think that since main() is a static method, it should run automagically
when you deploy your app into webapps and start tomcat.
b) You can confirm this by writing a fake webapp (real quick) where the main
method contains print_out statements to your catalina.log
c) If you see these log statements in catalina.log or wherever else you
tried to output them to then your code in main() should have run.
d) Now, put similar print statements in your real webapp's main() method
inside the try and catch block so that you know if you are listening or
failing.
e) You can also write a test class that prints an UDP message on the port
that you are either hard-coded to listen to or maybe have a configuration
file for. In turn, have your listening webapp print any messages it
captures. Then looking at the file (stdout or catalina.out) where you
printed the message...you should have a good feel for where you stand.

Cheers,
- Pulkit

On 12/26/05, kjr_23 <[EMAIL PROTECTED]> wrote:
>
> I'm developing an application that will monitor a port on Tomcat 5.5.x and
> receive udp datagrams.  I've got the class coded, but not sure if I've
> done
> it correctly.  I created a class with a main() method that runs the code
> to
> read from whatever port I specify.  Do I need to configure Tomcat to open
> this port or listen on the port?  Should I inherit my server class from
> thread, so it can be multithreaded?  How do I know my application is
> running?  I usually just develop classes/applications that are initiated
> by
> JSP pages.
>
> Thanks,
> K
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to