Test Series - html

Test Number 28/72

Q: Which of the following is not associated with web socket communication?
A. https
B. wss
C. ws
D. http
Solution: For opening WebSocket we call WebSocket constructor. The syntax is
var conn=new WebSocket(‘ws://rtyyghj.websocket.org/echo’,[‘brush’, ‘xmpp’]);
for using secure HTTP connections use https: ,ws: is the new URL scheme for connecting WebSockets. There is wss: also.
Q: Which of the following is the wire protocol for WebScoket?
A. RFC6455
B. RFC6477
C. RFC6567
D. RFC8967
Solution: Wire protocol is handshaking and data transferring between server and client. It is the RFC6455. Chrome for Android and Chrome are compatible with RFC6455. It includes binary messaging also. Firefox version 11 and Internet Explorer 10 is also compatible with this.
Q: The maximum bytes for control frames is _______________
A. 100 bytes
B. 125 bytes
C. 130 bytes
D. 150 bytes
Solution: Control frames must be of 125 bytes or less than this. Control frames must not be fragmented. They have opcode of 0x02 (Ping), 0x01 (close) or 0x03 (Pong). Control frames help in communicating state about webSocket.
Q: Which of the following is the server library for Node.js?
A. Caddy
B. SignalR
C. ws
D. jsonrpc
Solution: ws is server library and WebSocket client for Node.js. Caddy is used for proxying arbitrary commands. WebSocket under covers is used by SignalR. To use asynchronous RPC library with the bidirectional call we use JSONRPC.server.
Q: In desktop which browser does not support WebSocket?
A. Chrome version 7
B. Chrome version 6
C. Chrome version 43
D. Internet Explorer 10
Solution: In desktops, WebSockets are supported by Chrome version-6, version-43, version-14. Edge-14 supports WebSockets. All the versions of firefox support WebSocket. Opera version-76 and version-7 do not support WebSocket. Safari version-5.0.1 and version-6.0 support WebSocket.
Q: Which one is not associated with Gecko?
A. Firefox
B. SeaMonkey
C. Thunderbird
D. Internet Explorer
Solution: Gecko 7.0 includes Firefox 7.0/SeaMonkey 2.4/Thunderbird 7.0. Gecko 8.0 includes Firefox 8.0/SeaMonkey 2.5/Thunderbird 8.0. In Gecko 11.0 WebSocket API is no longer used as a prefix. In Gecko 7.0 network.websocket.max-connections is used.
Q: Messages from the server are received by ____
A. onmessage
B. send
C. arrayBuffer
D. blob
Solution: onmessage function is used for receiving messages from the server. E.g. memeDocket.onmessage = function (eve) { console.log(eve.data); }. For sending data as a string we use ArrayaBuffer and Blob.
Q: For duplex communication we can’t use ____________
A. Long Polling
B. HTML5
C. JavaScript
D. Streaming
Solution: There are some existing techniques for the communication between client and server known as duplex techniques. They are Streaming, HTML5, Postback and AJAX, Long Polling, Polling. For real-time transferring of data, Streaming is the best option. Polling performs periodic requests.
Q: Which of the following is not the event of WebSocket API?
A. Close
B. Message
C. Send
D. Error
Solution: There are four WebSocket API, Close, Message, Error and Open. We can implement these events by using functions like onmessage, onopen, onerror, addEventListener and onclose. When there is an end of communication between client and server then onclose method is called.
Q: Which one is not a very good developer support?
A. Opera
B. Internet Explorer
C. Firefox
D. Chrome
Solution: Firefox, Chrome and Opera are the very good browser in terms of developer support. They have various built-in tools for the interaction of client-side and resources. It is also very helpful for security purposes.

You Have Score    /10