-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMini-Test.txt
More file actions
79 lines (69 loc) · 2.7 KB
/
Mini-Test.txt
File metadata and controls
79 lines (69 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
1.
a) The Request-Line begins with a method token, followed by the
Request-URI and the protocol version, and ending with CRLF. The
elements are separated by SP characters. No CR or LF is allowed
except in the final CRLF sequence.
Request-Line = Method SP Request-URI SP HTTP-Version CRLF
b) GET HTTP/1.1
Host: 192.168.1.1:8080
c) Accept: Content-Types that are acceptable for the response
Accept-Encoding: List of acceptable human languages for response
2.
a) Socket class, ?? class
b) Blocking" means that the caller waits until the callee finishes its processing.
For instance, a "blocking read" from a socket waits until there is data to return;
a "non-blocking" read does not, it just returns an indication (usually a count) of
whether there was something read.
In the case of InputStream the .read() feature call blocks while it waits for data,
all the others (for example available())
don't.
OutputStream, however, does never block.
3.
a) wrong, REST is an architectural style and approach to web communication
rather than a protocol. It is, however, an alternative to SOAP.
b) wrong, stateless means the opposite. No context from previous requests is
used to process a new request.
c) correct
d) correct
4.
a) http://vslab.inf.ethz.ch:8080/SunSPOTWebServices/SunSPOTWebservice?wsdl
It can be retrieved over the link?
b) http://vslab.inf.ethz.ch:8080/SunSPOTWebServices/SunSPOTWebservice?wsdl
<operation name="getSpot">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="SunSpotsWSException">
<soap:fault name="SunSpotsWSException" use="literal"/>
</fault>
</operation>
<operation name="getDiscoveredSpots">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
c)
5.
a)
10.0.2.15
It is the device’s within each instance of an emulator. The emulator does its own address translation to the emulated device. However, by connecting to 10.0.2.15 on your development machine you cannot connect to any emulated device.
b)
emulated device’s loopback interface, so a call to the emulated device itself
c)
10.0.2.2
d)
by using the telnet interface of the android emulator.
A redirection from the development machine’s port to the emulated device’s port has to be added.
We did it like this:
telnet localhost 5554 // 5554 is the port on which the emulator listens
auth <auth_token> // authentication required
redir add tcp:8088:8088 // so all connections on dev machine’s port 8088 are redirected to the emulated device’s port 8088 (in our case it was 8088)
Via localhost:8088 the dev machine can then connect to the emulated device.