Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagram Packet 1

Status
Not open for further replies.

dcusick

Technical User
Aug 9, 2000
271
US
What's up everyone? Quick question for you. I have to write a program that receives Datagram packets. I need to know when the packets are received. I assume I would just go into an infinite loop and look for some condition. What condition is it though? At what point do I know that a packet was actually received? Thanks.

Doug
 
I assume you're already looking at java.net.DatagramSocket? Liam Morley
lmorley@gdc.wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."
 
Hi,

You will have to open a Server socket at a perticular port and wait for any packets to arrive. You will be in a while loop or something while reading is true. Once data is arrived, you can find out the packet content.

As you probably will know that Datagram Packets are connection less, you just hope to receive.

Good luck

Best Regards,
guna
 
Thanks guna, that's just what I did... Got me going and I was able to see the recieved data over the socket. Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top