You are on page 1of 2

EXAMEN MODULO 15

NETWORKING
EVALUACIÓN DEL APRENDIZAJE

Nombre: ____________________________________________________
Fecha: __________e-mail: ______________________________________
Tiempo para resolverlo: 15 minutos.

1. What it is a socket?
Select any one option.

a) Is a system that is used to comunicate between two telephones.


b) Is used to block the comunication on the workstations connected to the
network.
c) Is used as a tool to emule a Firewall.
d) A socket is a comunication system between two machines on the network.

2. Which one of the following declarations is valid and compile without


error?

a) Socket miCliente;
miCliente = Socket( "Diana", 5432 );
b) Socket miServicio;
try {
miServicio = new ServerSocket( 5432 );
} catch( ArrayIndexOutOfBoundsException e ) {
System.out.println( e );
}
c) Socket miServicio;
try {
miServicio = new ServerSocket( 5432 );
} catch(IOException e ) {
System.out.println( e );
}
d) None of the above.

3. Which of the following are methods used on the ServerSocket class?

a) open()
b) close()
c) accept()
d) closed()
4. Which of the following piece of code is an example of the
Server listen for a connection?

a) Socket socketServicio = null;


try {
socketServicio = miServicio.accept();
} catch( IOException e ) {
System.out.println( e );
}
b) Socket socketServicio = null;
try {
socketServicio = miServicio.open();
} catch( IOException e ) {
System.out.println( e );
}
c) Socket socketServicio = null;
try {
socketServicio = miServicio.accept();
} catch( NullPointerException e ) {
System.out.println( e );
}
d) None of the above

5. The following are the simpler steps of the Java Networking Model

According to the figure, put in order the following steps:

___ The Server uses a port and wait (timeout seconds) to the cliente to establish a
conection.
___ The client and the Server comunicate with InputStream and OutputStream.
___ The client establish a conecction with the host machine throw the port number
that we choose.
___ When the client request a conection, the Server will open the socket connection
with the method accept().

You might also like