Abhay Agarwal wrote:Welcome to Java Ranch !!!
you can write a Generic Servlet which will have 3 methods
a. init()
b. service()
c. destroy()
In init() method, you can write code which listens to port 7080
When ever a message is recieved on port 7080, control goes to service() method where you can construct sip message using the caller-callee information. Then control can be forwarded to SIPServlet with required information
In destroy() method, you can discontinue listening to port 7080 (closing the socket)
~ abhay
Thanks a lot Abhay !!!
I have one doubt regarding the approach you suggested. As per specification of jsr289 and container manual, it says we should not spawn a new
thread from servlet, as container manages the thread pool ( Please Correct me if i am wrong.
1. Will it be okay to spawn a thread from init ?
2. The thread that gets spawned through init() is container thread or an independent thread ( How can i verify this by looking at thread signature ...).
Thanks you
Regards,
Ankit Bhandari