wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Socket in Java

Total questions: 18

Worksheet time: 18mins

Name
Class
Date
1.
Socket programming can only be done in Java.
a)
True
b)
False
2.
Sockets are different from ports because
a)
They included IP addresses
b)
They are in the Application Layer
c)
They use the OSI model
d)
They are just another term for the same thing
3.
TCP socket programming is:
a)
connection-oriented
b)
connectionless
c)
dependent on the host operating system
d)
dependent on the client operating system
4.
User-defined socket programming occurs with ports
a)
>256
b)
>1024
c)
>32K
d)
Any may be used
5.
Multiple port numbers are used on the client side to define
a)
Multiple simultaneous server connections
b)
Multiple server connections to different servers
c)
Multiple receive sockets
d)
This just isn't done
6.
Single-thread TCP sockets are used for
a)
One server - one client communications
b)
One server - multiple client communications
c)
e-mail distribution
d)
social media
7.
A stream is
a)
A TCP data transport link
b)
A group of socket connections
c)
A group of packets
d)
A UDP transport link
8.
What must be done before disconnecting a socket?
a)
Ending the data stream
b)
Telling the server good-bye
c)
Flushing the cache
d)
Nothing, you can simply "unplug" with no ill effects
9.
UDP sockets trace lost packets by
a)
RequestCheck command
b)
AutoCorrect command
c)
Verify command
d)
Lost packets are not checked in UDP
10.
Multi-thread socket programming allows for
a)
Servers to connect with multiple clients
b)
Clients to connect to multiple servers simultaneously
c)
Both of these
d)
Neither of th
11.
What happens if you fail to stop the stream before closing the socket?
a)
Data loss
b)
Nothing
c)
Logic error
d)
Socket lockup
12.

Classe per la creazione di un applicativo server in ascolto

a)

Socket

b)

ServerSocket

c)

Server

d)

DatagramSocket

13.

Classe per la creazione di un canale di comunicazione tra server e client

a)

Socket

b)

ServerSocket

c)

Server

d)

DatagramSocket

14.

Classe per l'astrazione dal particolare tipo di indirizzo

a)

InetAddress

b)

Address

c)

Server

15.

Metodi per la gestione degli indirizzi dei sistemi nell'uso di Socket

a)

getLocalHost()

b)

putByName()

c)

changeByHost

d)

isAnyLocalAddress()

16.

Metodi della classe ServerSocket

a)

accept()

b)

bind()

c)

chiudi()

d)

changeLocalAddress()

17.

Metodi della classe Socket

a)

isClosed()

b)

isConnected()

c)

open()

d)

changeLocalAddress()

18.

which of this class is used by character streams for reading data from buffer

a)

BufferReader

b)

InputStreamReader

c)

FileReader

d)

FileInputStream