Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DatagramSocket & DatagramPacket Related  RSS feed

 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello World,
I have a small doubt about DatagramSocket & DatagramPacket :
In the receive method of DatagramSocket class i have to pass the Object of
DatagramPacket, for this i am using the following constructor:

public DatagramPacket(byte[] buf,int length)
In above constructor how i will decide the size of byte array "buf" .
right now i am hardcoding it as 100 elements.
byte []buf=new byte[100];
i want to set it dynamically,is it possible?

Thanx in Advance
Shrinivas
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!