-
1. Re: a program in jboss that listens on a port
camel Mar 17, 2004 2:38 AM (in response to alanc_yang)You could impmenent this as a jboss service. What is your program going to do? If it's going to be your basic request/response server (even with long-lived connections), you may be able to implement it as a servlet. Not an HttpServlet, but just a custom servlet (i.e., it implements the Servlet interface or extends javax.servlet.GenericServlet).
Assuming you need a protocol other than HTTP, you can write a custom protocol handler ("connector" in Tomcat lingo) that reads the data, builds a ServletRequest object (not HttpServletRequest), and calls the server to map it and service it. This is how tomcat accepts JK2 requests from Apache httpd.
I actually did this for a school project, and implemented several interesting protocol connectors and servlets, for services like DNS, SMTP, POP3, HTTP, and finger. (I didn't use tomcat; I wrote my own mini-servlet container, but you may be better off using something more tried-and-true like tomcat).
I can dig up the source if you're interested. -
2. Re: a program in jboss that listens on a port
alanc_yang Mar 17, 2004 8:15 AM (in response to alanc_yang)The program would listen on the port with tcp/udp or http that it process the command to send to client and process corresponding response. If you can send your source that would be very very useful. Really appreciate.
Alan -
3. Re: a program in jboss that listens on a port
alanc_yang Mar 17, 2004 8:22 AM (in response to alanc_yang)Could you please send your source to: alanc_yang@yahoo.com? Thanks again for your help.
- Alan -
4. Re: a program in jboss that listens on a port
camel Mar 17, 2004 7:31 PM (in response to alanc_yang)Comin your way.
-
5. Re: a program in jboss that listens on a port
alanc_yang Mar 22, 2004 10:58 AM (in response to alanc_yang)opened a DatagramSocket from within mbean service, no problem!