Originally Posted by
hemant
... after a certain time i'll return to rcv meanwhile packets would have kept on queuing . so i cannot know their exact time?
The way to approach this is a short, and I mean really short, code block snuggled up on accept, that .... ....? Why is this so important -> you are trying to correctly identifiy traffic so that requests can be grouped together? Session tracking, logging? There is some goal you are trying to attain that can be put into words. If not, you are trying to do systems work and that can end up with a cross-lock.
can you suggest any way that i should interuupt my current thread whenever a packet comes to save it in a byte array?... but this'll waste a lot of ( processor power ).
Send and receive run almost asynchronously, and are programmed at a level below Java. I am writing right now what I think you are trying to do. You likely want a SessionMaster object that can keep things organized. What happens if someone clicks the button twice accidenatlly?... happens all the time.