UDP Programming, Computer Networking

Assignment Help:
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

Related Discussions:- UDP Programming

What is the main purpose of ospf, What is the main purpose of OSPF? OSP...

What is the main purpose of OSPF? OSPF, or Open Shortest Path First, is a link-state routing protocol that uses routing tables to verify the best possible path for data exchang

Name the protocol responsible for finding the mac address , a)  What does t...

a)  What does the "CD" mean in the CSMA/CD? How is it implemented in the Ethernet?   b)  Consider an Ethernet hub with 8 ports and an Ethernet switch with 8 ports. In both cases

Networks classification - point to point network , Normal 0 fal...

Normal 0 false false false EN-IN X-NONE X-NONE Networks classification

What do mean by tunnel mode, What do mean by tunnel mode? This is a mod...

What do mean by tunnel mode? This is a mode of data exchange wherein two communicating computers do not use IPSec themselves. Instead, the gateway that is linking their LANs to

Show the class D and class E addresses, Q. Show the Class D and Class E Add...

Q. Show the Class D and Class E Addresses? Class D and Class E Addresses Class D - reserved for multicast addresses Multicasting - transmission method which allo

Internet transport service proposal, will you have this done to day? And ho...

will you have this done to day? And how long will this take?

Packet switching and virtual circuit packet switching, Describe Circuit swi...

Describe Circuit switching, Packet switching and Virtual Circuit Packet switching. Explain their suitability for different applications such as telephone and internet. Packet S

Security impact of not having a public key infrastructure, (a) You are pro...

(a) You are provided with the following: A. An RSA facility complete with public/private key pair B. A CBC (cipher block chaining) facility incorporating the IDEA block ciph

packing -unpacking data with parallel virtual machine , Packing and Unpack...

Packing and Unpacking Data pvm_packs - Pack the active message buffer with arrays of prescribed data type: int info = pvm_packf( const char *fmt, ... ) int info = pv

How to install an anti-virus program, In a network that contains two server...

In a network that contains two servers and twenty workstations, where is the best place to install an Anti-virus program? An anti-virus program must be installed on all servers

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd