Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help running this Java program with a screenshot and brief detail of what the program does. import java.io.*; import java.net.*; import java.util.*; public class

Need help running this Java program with a screenshot and brief detail of what the program does.

import java.io.*;

import java.net.*;

import java.util.*;

public class BufferedServer

{

public static void main (String[] args)

{

try {

int portNumber = 0; // let the system find an available port

to use.

ServerSocket ss = new ServerSocket(portNumber);

System.out.println("Server listening at " +

InetAddress.getLocalHost() +

" on port " + ss.getLocalPort());

while (true)

{

Socket s = ss.accept(); // wait here for a

client to call

InputStreamReader isr = new

InputStreamReader(s.getInputStream());

BufferedReader br = new BufferedReader(isr);

String msg = br.readLine();

System.out.println(msg);

}

}

catch(Exception e)

{

System.out.println(e);

}

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

56.If then nd E(X) and V(X) by differentiating a. MX(t) b. RX(t)

Answered: 1 week ago