WebSocket class implementing the pcp-protocol.
Creates a new WebSocket connection and uses the pcp-protocol for communication.
new sap.ui.core.ws.SapPcpWebSocket(sUrl, aProtocols?)
Param | Type | Default Value | Description |
---|---|---|---|
sUrl | string | relative or absolute URL for WebSocket connection. |
|
aProtocols? | array | array of protocols as strings, a single protocol as a string. Protocol(s) should be selected from sap.ui.core.ws.SapPcpWebSocket.SUPPORTED_PROTOCOLS. |
Method | Description |
---|---|
sap.ui.core.ws.SapPcpWebSocket.extend |
Creates a new subclass of class sap.ui.core.ws.SapPcpWebSocket with name
|
fireMessage |
Fires event message to attached listeners. |
sap.ui.core.ws.SapPcpWebSocket.getMetadata |
Returns a metadata object for class sap.ui.core.ws.SapPcpWebSocket. |
send |
Sends a message and optional pcp-header-fields using the pcp-protocol. If the connection is not yet opened, the message will be queued and sent when the connection is established. |
Creates a new subclass of class sap.ui.core.ws.SapPcpWebSocket with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.core.ws.WebSocket.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires event message to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
oParameters | object |
Parameters to pass along with the event |
|
data | string |
Received data from the server. |
|
pcpFields | string |
Received pcpFields as a key-value map. |
Returns a metadata object for class sap.ui.core.ws.SapPcpWebSocket.
Sends a message and optional pcp-header-fields using the pcp-protocol.
If the connection is not yet opened, the message will be queued and sent when the connection is established.
Param | Type | DefaultValue | Description |
---|---|---|---|
message | string Blob ArrayBuffer |
message to send |
|
oPcpFields | object |
additional pcp-fields as key-value map |