class sap.ui.core.ws.SapPcpWebSocket

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/core/ws/SapPcpWebSocket
Application Component: CA-UI5-COR

WebSocket class implementing the pcp-protocol.


Constructor

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.


Events Overview

Event Description
message

The message event is fired, when a message was received.

message

The message event is fired, when a message was received.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
data string

Received data from the server.

pcpFields string

Received pcpFields as a key-value map.


Methods Overview

Method Description
sap.ui.core.ws.SapPcpWebSocket.extend

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.

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.

sap.ui.core.ws.SapPcpWebSocket.extend

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

fireMessage

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.

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.

Param Type DefaultValue Description
message string Blob ArrayBuffer

message to send

oPcpFields object

additional pcp-fields as key-value map