jatin puri

+ Follow
since Sep 04, 2009
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jatin puri

Can some one please suggest a good advanced book on Concurrent Processes. Iam a bit confused in which one to follow.
Hi Steve, First of all Happy Diwali (Diwali is the biggest festival here in India)
I think i have found the solution to the problem. THe data is completely received. The thing it that can you please explain System.out.println(). Because the problem is if i make 2 threads and run them i

This code only receives the data,
to send packets you can use the below code

Now Run the 1st code and wait for around 20-30 sec to execute the 2nd code.why is it that [1] is not printed when 1st code is implemented and only after 2nd code runs the output is shown.
Similarly in my problem i have found that all the data is arriving but it is not printing on screen.
Thanks a lot of help.
The socket is an reference for DatagramSocket, and socket.receive(packet) is an inbuilt method which copies information from the packet which it receives from the network and puts the data in packet along with other information like destination address etc.
The reason why i dont execute retrieving the data in the the other thread is, because as you know in UDP there is no internal buffer, hence as soon as the packet arrives from the network it should be received or there will be a packet loss. Hence if i include the code which retrieves data from list and processes it, a lot of processor power will go into that (as in creation of jpacket there are a lot of algorithms implemented in it according to the data in packet).
So in the mean time iam loosing a lot of data. I actually tried that. That way i was almost loosing 50% of the packets.

PS: I have attached the code . Please help if you can
In the file. First say 'in' is an instance of SocketInputStream().
in.activate() is called which initiates a new Thread which only collects packets from network and add's it to the list.
Later when in.readData() is called : It removes packets from the list and later does calculation on that.

Iam stuck in this problem and have spent almost 5-6 hours in it.
In the project i am implementing TCP over UDP.
When stream.activate() is called the following new Thread is implemented

Now the main Thread checks if list has any packets in it
It implements the following code. Basically it checks if there list has any packets in it, if it has it get's the packet and then processes. But some how it doesnt proceed

Now the problem is as soon as the process reaches [1], it doesnt proceed forward. It cant be deadlock as their is nothing for deadlock.
hello!When in the below code if iam using a local address instead of yahoo.com,it is executing well,but if iam not using a local address then it is giving a java.net.SocketException.I use a proxy connection and i have set my proxy for java .pl help