2.
io.on("connection",function(socket){ //Your code }
With respect to the code above which is excerpted from the server side, the input parameter socket represents:
Select one:
a. response object
b. a common endpoint socket to all the connections
c. the server's socket
d. a socket to a new client
3.
client.synthesizeSpeech(request, (err, response) => { }
With respect to the code above which converts a text to a speech, what is the datatype of 'request'?
Select one:
a. array of characters
b. string
c. function
d. Object
4.
this.socket.emit("newMsg", this.messageText);
With respect to the statement above which is excerpted from pp.component.ts, what is the role of "newMsg"
Select one:
a. name of the server
b. confirmation text
c. the message
d. name of the event
5.
Socket.io is attached to an instance of ----
Select one:
a. express app
b. http.socket
c. http object
d. http.server
2) d. a socket to a new client
Reason: With respect to the code above which is excerpted from the server side, the input parameter socket represents a socket to a new client
3) d. Object
Reason: With respect to the code above which converts a text to a speech, the data type of request is Object.
4) d. name of the event
Reason: With respect to the statement above which is excerpted from pp.component.ts, the role of"newMsg" is name of the event.
5) d. http.server
Reason: Socket.io is attached to an instance of http.server
Get Answers For Free
Most questions answered within 1 hours.