Watson Developer Cloud Unity SDK
1.0.0
The Unity SDK uses the Watson Developer Cloud services, a collection of REST APIs and SDKs that use cognitive computing to solve complex problems.
|
WebSocket connector class. More...
Classes | |
class | BinaryMessage |
BinaryMessage for sending raw binary data. More... | |
class | Message |
The base abstract class for a Message that can be sent/received by this class. More... | |
class | TextMessage |
TextMessage is used for sending text messages (e.g. JSON, XML) More... | |
Public Types | |
enum | ConnectionState { ConnectionState.CONNECTING, ConnectionState.CONNECTED, ConnectionState.DISCONNECTED, ConnectionState.CLOSED } |
ConnectionState enumeration describes the current state of this connector. More... | |
Public Member Functions | |
delegate void | ConnectorEvent (WSConnector connection) |
Callback for a connector event. More... | |
delegate void | MessageEvent (Message resp) |
Callback for a message received on the connector. More... | |
void | Send (Message msg, bool queue=false) |
This function sends the given message object. More... | |
void | Close () |
This closes this connector, it will block until the send thread exits. More... | |
Static Public Member Functions | |
static string | FixupURL (string URL) |
Helper function to convert a HTTP/HTTPS url into a WS/WSS URL. More... | |
static WSConnector | CreateConnector (Credentials credentials, string url, string function, string args) |
Create a WSConnector for the given service and function. More... | |
Properties | |
ConnectorEvent | OnClose [get, set] |
This delegate is invoked when the connection is closed. More... | |
MessageEvent | OnMessage [get, set] |
This delegate is invoked when a message is received for a socket. More... | |
string | URL [get, set] |
The URL of the WebSocket. More... | |
Dictionary< string, string > | Headers [get, set] |
Headers to pass when making the socket. More... | |
Credentials | Authentication [get, set] |
Credentials used to authenticate with the server. More... | |
ConnectionState | State [get, set] |
The current state of this connector. More... | |
WebSocket connector class.
|
inline |
This closes this connector, it will block until the send thread exits.
delegate void IBM.Watson.DeveloperCloud.Connection.WSConnector.ConnectorEvent | ( | WSConnector | connection | ) |
Callback for a connector event.
connection | The WSConnector object. |
|
inlinestatic |
Create a WSConnector for the given service and function.
serviceID | The ID of the service. |
function | The name of the function to connect. |
args | Additional function arguments. |
|
inlinestatic |
Helper function to convert a HTTP/HTTPS url into a WS/WSS URL.
URL | The URL to fix up. |
delegate void IBM.Watson.DeveloperCloud.Connection.WSConnector.MessageEvent | ( | Message | resp | ) |
Callback for a message received on the connector.
resp | The message object. |
|
inline |
This function sends the given message object.
msg | This is either a BinaryMessage or TextMessage object. |
queue | If true, then this function will not signal or start the sending thread. |
|
getset |
Credentials used to authenticate with the server.
|
getset |
Headers to pass when making the socket.
|
getset |
This delegate is invoked when the connection is closed.
|
getset |
This delegate is invoked when a message is received for a socket.
|
getset |
The current state of this connector.
|
getset |
The URL of the WebSocket.