Monitoring WebSocket Connections

Transaction SMWS can be used to monitor the WebSocket connections in an instance. Furthermore, you can also display a system-wide list using a System -Wide List icon.

Note that not all columns are displayed in the default view. You can remove or add columns using Display variants.

The following columns are available in the process overview:

Column Overview of SMWS
Column Meaning
WebSocket Handle

The WebSocket handle is used to identify a WebSocket connection. The application server can take on the role of the client and the role of the server. If the application server assumes both roles, both client and server each have a separate and unique WebSocket handle. WebSocket handles are unique on each application server instance.

WebSocket Status

A WebSocket connection can have the following statuses:

  • Connecting: The WebSocket connection is opening.
  • Connected: The WebSocket connection is open and can be used for sending and receiving messages.
  • Disconnecting: The WebSocket connection will be closed shortly. In this case, no further WebSocket messages can be sent through this connection. The entry is kept until all inbound buffered WebSocket messages have been processed. As soon as the connection has been closed and all buffered WebSocket messages processed, the table entry is removed automatically.
  • Free: This status is set when the table entry is deleted and should therefore never actually exist in the WebSocket table.
Session Handling

Type of WebSocket session handling:

  • Stateless: For each inbound WebSocket message a new session is created in which the message is processed. In the next step, this session is deleted. Multiple sessions can exist in parallel.
  • Stateful: A specific session is assigned to the WebSocket. All inbound WebSocket messages are processed in this session one after the other.
  • None: This session handling can only occur temporarily when a client connection is being opened. In this case the assignment of the WebSocket to its session has already been removed.
Session Key

The internal key of a session consists of three parts:

  • Logon handle: Index in Logon Table
  • Logon ID: Unique ID of Logon
  • Session handle: Internal Number of Session

The session key is displayed in the format:

T<Logon Handle>_U<Logon ID>_M<Session Handle> 

It is also written to the developer trace in this format.

In transaction SM04 you can display additional information about a session.

Client

Client in which the current action is executed.

User Name

Name of user or logon whose session is being processed.

Received WebSocket Messages

The number of WebSocket messages received.

This counter is increased as soon as the ICM accepts a WebSocket message for the relevant WebSocket.

Sent WebSocket Messages

The number of WebSocket messages sent.

This counter is incremented by the task handler as soon as an outbound WebSocket message is forwarded to the ICM for sending.

Time of Last Data Exchange

This timestamp is refreshed as soon as data is received or sent through the WebSocket.

Application ID

Application that created and used the WebSocket.

Number of AMC Registries

If a WebSocket is registered for an ABAP Message Channel(AMC), all messages sent through this channel are automatically forwarded through this WebSocket. In this case the WebSocket is also contained in the AMC recipient table.

Close Sent By

Displays the process that initiated closing the WebSocket. This could be the Internet Communication Manager or a work process.

WebSocket Messages in the Queue

Number of inbound WebSocket messages in the queue.

This counter is increased by the Internet Communication Manager as soon as the ICM forwards an inbound WebSocket message to the task handler. If the task handler is processing the message, this counter is decremented.

WebSocket Messages in Processing

Number of inbound WebSocket messages currently being processed.

This counter is increased by the work process as soon as the work process processes an inbound WebSocket message that was sent from the Internet Communication Manager to the application. After the message has been processed, the counter is decreased.

Creation Time

Time when the WebSocket was created.

ICM Connection Handle

For each WebScoket there is a connection in the Internet Communication Manager. This is identifed by the connection handle.

IP of Caller

For server WebSockets the ID of the client is displayed here.

Application Connection Parameter

Connection parameter of the application that created and used the WebSocket.

Application Path

Path of the application that created and used the WebSocket.

Length of the Application Data Technical Information for diagnosis purposes internal to SAP.
Streaming Active/ Streaming Session

The Streaming Active column displays whether data is currently being sent through the WebSocket. If it is, the Streaming Session column contains the session that is sending the data.

Close Initiated By

As soon as the closing of a WebSocket has been initiated, the WebSocket entry is removed from the WebSocket table.

End Time

Time at which the closing of the WebSocket was initiated.

Trace If tracing for the WebSocket is activated, the trace level is also displayed:
  • Level 2: Errors and program flow are recorded.
  • Level 3: Errors, detailed program flow, and received and sent data parts are recorded.
If tracing for the associated WebSocket is deactivated, this field is empty: You can activate, deactivate, or display the trace for a WebSocket. Just select the required table row. Then choose the action you want from the WebSocket -> Trace menu.
WebSocket Role

There are the following roles:

  • Client: Page that created the WebSocket.
  • Server: Page that accepted the WebSocket.