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
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


NICs AND NETWORK HARDWARE:  NIC is create for one kind of physical network. For example Ethernet interface may not be needed with token ring and similar ATM interface cannot b

Q. Example on TCP numbering? Envision a TCP connection is transferring a file of 6000 bytes. The first byte is numbered 10010. What are the sequence numbers for every seg

MPI parallel programs are written with conventional languages like, C and Fortran  .One or more header files such as "mpi.h" may be needed to give the necessary definitions and dec

Retransmission of packets The disadvantage  of thronging away a correctly received packet is that  the subsequent retransmission  of the  packet might  be lost  or garbled and

Question : a) Explain why pervasive computing can be termed as a "technology that disappears". b) List and briefly explain four main components of a MOTE used in Wireless

Q. How two adjacent layers communicate in a layered network or what do you understand by Service Access Point? Ans: In layered network, each layer has several entities and enti

Butterfly permutation This permutation is getting by interchanging the important significant bit in address with smallest significant bit.

ROLE OF DESIGN IN ACHIEVING RELIABILITY One of the most important methods for achieving high reliability is through design.  Use reliability cannot be higher than the design re