Results 1 to 1 of 1
Thread: Question about DatagramPacket
- 04-01-2011, 09:59 PM #1Member
- Join Date
- Apr 2011
- Rep Power
Question about DatagramPacket
I'm working on a project and I have a question.
I'm using a UDP connection to send messages between the client and the server.
Using a DatagramPacket, I have to send a string (sendData). I'm using:
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, IPAddress, 9876);
So far so good. The problem is that the professor wants us to send, at the same time a "fake checksum", in this case it would be an int.
Since the DatagramPacket class is final, it can't be extended to add thee new parameter I want to add.
Here is my question:
How can I send that int value if the class has defined parameters?
Thank you in advance
- By kmjt in forum New To JavaReplies: 2Last Post: 01-27-2011, 05:01 PM
- By jim01 in forum New To JavaReplies: 17Last Post: 01-14-2011, 01:05 AM
- By orchid in forum Advanced JavaReplies: 9Last Post: 12-19-2010, 09:49 AM
- By Java_Fanatic in forum New To JavaReplies: 10Last Post: 10-13-2009, 11:18 PM
- By sranil in forum NetworkingReplies: 2Last Post: 04-28-2009, 02:52 AM