Lecture 3 Flashcards

1
Q

Which ports are reserved for standard protocols?

A

0-1023

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What commands are supported by HTTP?

A

GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is POP? What’s its port? What commands?

A

Post Office Protocol

Port 110

USER, PASS, STAT, RETR, DELE, QUIT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How is input/output done in java with sockets

A

Input/output streams

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How is a socket constructed in java?

A

Socket s = new Socket(hostname, portnumber);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the accept() methofd do on a ServerSocket?

A

Block the thread until a client connects, and when it does, return a Socket object representing that client’s socket.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you get the input and output streams of a socket?

A

InputStream in = s.getInputStream();

OutputStream out = s.getOutputStream();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What ae object streams?

A

ObjectInputStream/ObjectOutputStream

Automatically serialises serialisable objects and sends them over the stream, before being deserialised on the other end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does RMI work?

A

Client calls method on client side proxy

Client side proxy packages the info and sends it via network to the serer side proxy

server side proxy depackages it, makes a call to the local (server) method, and packages the return info up -> sends back to client

client side proxy unpackages the result and gives it to the client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the RMI program deal with locally?

A

stubs that implement the interface Remote

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

RMI calls are asynchronous

T or F

A

F - they are synchronous (blocking)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What 5 steps are involved in creating a RMI server?

A

Define remote interface

Write a remote implementation

Start the RMI registry

Create the remote service

Register the service with the registry

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does a remote interface contain?

What constraints are on the methods?

A

Stub methods that can be implemented on the server

Must declare RemoteException, return values must be primitive or serialisable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the easiest way to create a RMI server

A

Extend java.rmi.server.UnicastRemoteObject

Add constructor that can throw RemoteException

Register the service (usually in static main() method)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is an RMI registry?

A

Service that registers/looks up RMI server objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The RMI registry is typically started on each client machine

T or F

A

F - it’s started on the server machine

17
Q

Each server requires a separate RMI registry

T or F

A

F - servers may share registries

18
Q

With a reference to a RMI registry, what else must be done to start an RMI server?

A

Create a service object

Bind the service object to a name in the registry

19
Q

What is an RMI callback?

A

Client passes remote object to server

Server can then call methods on that remote object (which execute on the client)

20
Q

what does RMI require to download classes?

A

A securitymanager

21
Q

How can RMI stuff be made robust?

A

Use socket timeouts to prevent infinite blocking in case of remote errors