Chapter 3
Socket Overview
There is a meter some where between our
house and the rest of the network. For each kilowatt of power that goes
through that meter, we are billed. The bill comes to our address. So even
though the electricity flows freely around the power grid, all of the sockets in
our house have a particular address. The same idea applies to network sockets,
except we talk about TCP/IP packets and IP addresses rather than electronsand street addresses. Internet Protocol (IP) is a low-level routing protocol that
breaks data into small packets and sends them to an address across a network,
which does not guarantee to deliver said packets to the destination.
Transmission Control Protocol (TCP) is a higher-level protocol that manages to
robustly string together these packets, sorting and re-transmitting them as
necessary to reliably transmit our data. A third protocol, User Datagram
Protocol (UDP), sits next to TCP and can be used directly to support fast,
connectionless, unreliable transport of packets.
1 Calling Server Socket() constructor with port value 'zero'
means______________________.= use a port number that is automatically allocated.
2 TCP/IP reserves the ____________ ports for specific protocols = lower 1024
3Which of these package contains classes and interfaces for
networking?= java.net
4 A ServerSocket can connect to ________ clients. = multiple
5 A set of rules that governs data communication. = protocol
6 A socket identifies __________ in network. = a communication end point
7 A socket is combination of = Both A and B
8A socket is __________________ of a two-way communication link
between two programs running on two hosts in the network.
= one end-point
9 Access control does not deals with = Authenication
10A_______ is responsible for determining whether code executing in
the Java runtime environment has permission to perform a securitysensitive
operation.= policy object
11 byte[] getData() method of DatagramPacket class
returns______________________
= Byte array of data contained in datagram
12Class URL represents __________________________________, a
pointer to a "resource" on the World Wide Web
= Uniform Resource Locator
13 Communication using TCP protocol is __________and _________ = connection-oriented, concurrent
14Connection oriented communication is possible using
___________________classes of Java.
= Socket and ServerSocket
15 How many bits are in a single IPv4 address? = 32
16 How many bytes are required to represent an IPv4 address? = 4
17In InetAddress class which method returns the host name of the IP
Address? = public String getHostName()
18 In the format for defining the URL what is the last part? = File path
Welcome M3001 [117.239.186.68]
My Home Log Out
Maharashtra State Board of Technical Education
(A utonomous) (ISO 9001:2008) (ISO/IEC 27001:2005)
19 In the URL, http://www.osborne.com:80/index.htm, 80 represents = Port number
20 In UDP send() and receive() methods belong to which class? = DatagramSocket
21 In which class the constructors are not visible = Inetaddress class
22 Inet Address class encapsulates__________________ = Both A and B
23 IP Stands for ________ = Internet Protocol
24 Java.net package include following classes. = URLConne
ction, Socket, InetAddress
25Name the class which is used to create a port where the server will
listen?= ServerSocket
26 Permission class of java.security package is _______ class = abstract
27 Permission class belongs to which package? = java.security
28 Port Number for FTP is = 21
29 Port number of Email is ____________. = 25
30 Pretty Good Privacy (PGP) is used in security of = Email
31 Reserved port no of HTTP = 80
32 Resolver in DNS sysytem maps = Domain name to ip address
33 Select the proper constructor of ServerSocket class = All of above
34 Select the proper constructor of URL class = All of the above
35 TCP is Which Type of Protocol ? = Connection oriented protocol
36 TCP is _________oriented protocol = stream
37 TCP Stands for ________ = Transmission Control Protocol
38 TCP/IP sockets are used to impelement __________ connections. = All of the above
39The class which encapsulates both the numerical IP address and the
domain name for that address.= InetAddress
40The constructor which is used in ServerSocket may
be______________.= ServerSocket (int port).
41 The constructor which is used to create client socket is ____________. = Socket(InetAddress IPAddress, int port).
42The factory method for retrieving objects of InetAddress is
___________________.
= All of the mentioned
The factory method which returns an array of InetAddresses that
represent all of the addresses that a particular host name resolves to.= getAllByName( )
44The java.net.InetAddress class provides methods to get
the________________________
= IP of any host name
45 The method int getPort( ) of Socket class returns____________ = remote port to which this Socket object is connected.
46The number 80 in following URL specifies?
= Port number
http://www.rediff.com:80/index.htm/
47 The openConnection() is the method of which Class? = URLConnection
48The openConnection() method of URL class return_____________Object.
= URLConnection
49 The return type of getHostAddress() method is_____________ = string
50The server listens for a connection request from a client using the
following statement:
= Socket s = ServerSocket.accept()
Socket Overview

house and the rest of the network. For each kilowatt of power that goes
through that meter, we are billed. The bill comes to our address. So even
though the electricity flows freely around the power grid, all of the sockets in
our house have a particular address. The same idea applies to network sockets,
except we talk about TCP/IP packets and IP addresses rather than electronsand street addresses. Internet Protocol (IP) is a low-level routing protocol that
breaks data into small packets and sends them to an address across a network,
which does not guarantee to deliver said packets to the destination.
Transmission Control Protocol (TCP) is a higher-level protocol that manages to
robustly string together these packets, sorting and re-transmitting them as
necessary to reliably transmit our data. A third protocol, User Datagram
Protocol (UDP), sits next to TCP and can be used directly to support fast,
connectionless, unreliable transport of packets.
1 Calling Server Socket() constructor with port value 'zero'
means______________________.= use a port number that is automatically allocated.
2 TCP/IP reserves the ____________ ports for specific protocols = lower 1024
3Which of these package contains classes and interfaces for
networking?= java.net
4 A ServerSocket can connect to ________ clients. = multiple
5 A set of rules that governs data communication. = protocol
6 A socket identifies __________ in network. = a communication end point
7 A socket is combination of = Both A and B
8A socket is __________________ of a two-way communication link
between two programs running on two hosts in the network.
= one end-point
9 Access control does not deals with = Authenication
10A_______ is responsible for determining whether code executing in
the Java runtime environment has permission to perform a securitysensitive
operation.= policy object
11 byte[] getData() method of DatagramPacket class
returns______________________
= Byte array of data contained in datagram
12Class URL represents __________________________________, a
pointer to a "resource" on the World Wide Web
= Uniform Resource Locator
13 Communication using TCP protocol is __________and _________ = connection-oriented, concurrent
14Connection oriented communication is possible using
___________________classes of Java.
= Socket and ServerSocket
15 How many bits are in a single IPv4 address? = 32
16 How many bytes are required to represent an IPv4 address? = 4
17In InetAddress class which method returns the host name of the IP
Address? = public String getHostName()
18 In the format for defining the URL what is the last part? = File path
Welcome M3001 [117.239.186.68]
My Home Log Out
Maharashtra State Board of Technical Education
(A utonomous) (ISO 9001:2008) (ISO/IEC 27001:2005)
19 In the URL, http://www.osborne.com:80/index.htm, 80 represents = Port number
20 In UDP send() and receive() methods belong to which class? = DatagramSocket
21 In which class the constructors are not visible = Inetaddress class
22 Inet Address class encapsulates__________________ = Both A and B
23 IP Stands for ________ = Internet Protocol
24 Java.net package include following classes. = URLConne
ction, Socket, InetAddress
25Name the class which is used to create a port where the server will
listen?= ServerSocket
26 Permission class of java.security package is _______ class = abstract
27 Permission class belongs to which package? = java.security
28 Port Number for FTP is = 21
29 Port number of Email is ____________. = 25
30 Pretty Good Privacy (PGP) is used in security of = Email
31 Reserved port no of HTTP = 80
32 Resolver in DNS sysytem maps = Domain name to ip address
33 Select the proper constructor of ServerSocket class = All of above
34 Select the proper constructor of URL class = All of the above
35 TCP is Which Type of Protocol ? = Connection oriented protocol
36 TCP is _________oriented protocol = stream
37 TCP Stands for ________ = Transmission Control Protocol
38 TCP/IP sockets are used to impelement __________ connections. = All of the above
39The class which encapsulates both the numerical IP address and the
domain name for that address.= InetAddress
40The constructor which is used in ServerSocket may
be______________.= ServerSocket (int port).
41 The constructor which is used to create client socket is ____________. = Socket(InetAddress IPAddress, int port).
42The factory method for retrieving objects of InetAddress is
___________________.
= All of the mentioned
The factory method which returns an array of InetAddresses that
represent all of the addresses that a particular host name resolves to.= getAllByName( )
44The java.net.InetAddress class provides methods to get
the________________________
= IP of any host name
45 The method int getPort( ) of Socket class returns____________ = remote port to which this Socket object is connected.
46The number 80 in following URL specifies?
= Port number
http://www.rediff.com:80/index.htm/
47 The openConnection() is the method of which Class? = URLConnection
48The openConnection() method of URL class return_____________Object.
= URLConnection
49 The return type of getHostAddress() method is_____________ = string
50The server listens for a connection request from a client using the
following statement:
= Socket s = ServerSocket.accept()
No comments:
Post a Comment