UDP Programming, Computer Networking

I have a larget text file of 1MB, how do i break down into chunks of packets to send over UDP?

byte b[]=new byte[1024];
FileInputStream f=new FileInputStream("input.txt");
DatagramSocket dsoc=new DatagramSocket(2000);
int i=0;
while(f.available()!=0)
{
b[i]=(byte)f.read();
i++;
}
f.close();
dsoc.send(new DatagramPacket(b,i,InetAddress.getLocalHost(),1000));

this doesnt seems to work
Posted Date: 11/12/2012 12:21:32 AM | Location : Singapore







Related Discussions:- UDP Programming, Assignment Help, Ask Question on UDP Programming, Get Answer, Expert's Help, UDP Programming Discussions

Write discussion on UDP Programming
Your posts are moderated
Related Questions
What are the types of Transmission media? Signals are usually transmitted over some transmission media that are broadly divided in to two categories:- Guided Media: Th

Q. Illustrate Error Detection-Simple Parity Check? Error Detection-Simple Parity Check A redundant bit called as Parity Bit? is added to every data unit. Even Pa

Q. Describe about Domain Name Space ? - Structure for systematize the name space in which names are defined in an inverted-tree structure with the root at the top - Every l

If the amount of the application runs on the Client side, then it is Fat clients. It is mostly used for decision support and personal software. If the amount of the application

Computer Networks 1. Write about different network structures in use. 2. Explain the architecture and usage of ISDN. 3. Describe the concept of framing in Data Link Layer

Length This is a 16 bit  field  that  defines  the total  length  of the user  datagram, header  plus data. This 16 bit  can define  a total  length  of a 0 to 65, 535 bytes.



Q. Define V - 32 modem? - ITU-T's V.32 standard was issued in 1989 for asynchronous and full-duplex operation at 9600 bps. - Even though designed for asynchronous DTEs two

Error Detecting Code - Parity bit: The general idea for achieving error detection and correction is to add some redundancy (i.e., some extra data) to a message, which receiver