Ballerina API Documentation

Functions of ballerina.net.ws package

function addConnectionToGroup(string connectionGroupName)

This pushes text from server to all the connected clients of the service.

Parameters:

Parameter NameData TypeDescription
connectionGroupNamestringName of the connection group

function broadcastText(string text)

This pushes text from server to all the connected clients of the service.

Parameters:

Parameter NameData TypeDescription
textstringText which should be sent

function closeConnection()

Close the current client connection

Parameters:

Parameter NameData TypeDescription

function closeConnectionGroup(string connectionGroupName)

Close all the connections in connection group.

Parameters:

Parameter NameData TypeDescription
connectionGroupNamestringName of the connection group

function closeStoredConnection(string connectionName)

Close stored connection.

Parameters:

Parameter NameData TypeDescription
connectionNamestringName of the connection

function pushText(string text)

This pushes text from server to the the same client who sent the message.

Parameters:

Parameter NameData TypeDescription
textstringText which should be sent

function pushTextToConnection(string connectionName, string text)

Push text to the connection chose by the user from the connection store.

Parameters:

Parameter NameData TypeDescription
connectionNamestringName of the connection
textstringText which should be sent

function pushTextToGroup(string connectionGroupName, string text)

Push text from server to all the connected clients of the service.

Parameters:

Parameter NameData TypeDescription
connectionGroupNamestringName of the connection group
textstringText which should be sent

function removeConnectionFromGroup(string connectionGroupName)

Removes connection from a connection group.

Parameters:

Parameter NameData TypeDescription
connectionGroupNamestringName of the connection group

function removeConnectionGroup(string connectionGroupName)

Removes connection group.

Parameters:

Parameter NameData TypeDescription
connectionGroupNamestringName of the connection group

function removeStoredConnection(string connectionName)

Removes connection from a connection store.

Parameters:

Parameter NameData TypeDescription
connectionNamestringName of the connection

function storeConnection(string connectionName)

Store the connection globally for the use of other services.

Parameters:

Parameter NameData TypeDescription
connectionNamestringName of the connection


Connectors of ballerina.net.ws package

connector ClientConnector (string url, string callbackService)

Parameters:

Parameter NameData TypeDescription
urlstring
callbackServicestring

Actions:

action pushText()

Push text to the server

Parameters:

Parameter NameData TypeDescription


Annotations of ballerina.net.ws package

annotation ClientService

Attributes:

Attribute NameData TypeDescription

annotation OnClose

Attributes:

Attribute NameData TypeDescription

annotation OnOpen

Attributes:

Attribute NameData TypeDescription

annotation OnTextMessage

Attributes:

Attribute NameData TypeDescription

annotation WebSocketUpgradePath

Attributes:

Attribute NameData TypeDescription
valuestring


Menu

  • Functions
    • addConnectionToGroup(string connectionGroupName)
    • broadcastText(string text)
    • closeConnection()
    • closeConnectionGroup(string connectionGroupName)
    • closeStoredConnection(string connectionName)
    • pushText(string text)
    • pushTextToConnection(string connectionName, string text)
    • pushTextToGroup(string connectionGroupName, string text)
    • removeConnectionFromGroup(string connectionGroupName)
    • removeConnectionGroup(string connectionGroupName)
    • removeStoredConnection(string connectionName)
    • storeConnection(string connectionName)
  • Connectors
    • ClientConnector (string url, string callbackService)
      • pushText()
  • Annotations
    • ClientService
    • OnClose
    • OnOpen
    • OnTextMessage
    • WebSocketUpgradePath

Copyright 2017 Ballerina API Documentation