0% found this document useful (0 votes)
22 views

Java 2

The document describes a program that takes user input of frame numbers, sends the frames over a connection, and resends a specific frame on request.

Uploaded by

raj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Java 2

The document describes a program that takes user input of frame numbers, sends the frames over a connection, and resends a specific frame on request.

Uploaded by

raj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

c=dis.

read();

Scanner sc=new Scanner(System.in);

a=new int[c];

System.out.println("Enter "+c+" frames: ");

for(int i=0;i<c;i++){

a[i]=sc.nextInt();

dos.write(a[i]);

dos.flush();

System.out.println("The number of packets sent is:" + a.length);

int y = a.length;

dos.write(y);

dos.flush();

int k = dis.read();

System.out.println("Resending frame "+(k+1)+" again..");

f=a[k];

dos.write(f);

dos.flush();

System.out.println("Quiting");

catch (IOException e) {

System.out.println(e);

finally {

try {

dis.close();

You might also like