Lean  $LEAN_TAG$
QuantConnect.Brokerages.WebSocketClientWrapper Class Reference

Wrapper for System.Net.Websockets.ClientWebSocket to enhance testability More...

Inheritance diagram for QuantConnect.Brokerages.WebSocketClientWrapper:
[legend]

Classes

class  BinaryMessage
 Defines a byte-Type message of websocket data More...
 
class  MessageData
 Defines a message of websocket data More...
 
class  TextMessage
 Defines a text-Type message of websocket data More...
 

Public Member Functions

void Initialize (string url, string sessionToken=null)
 Wraps constructor More...
 
void Send (string data)
 Wraps send method More...
 
void Connect ()
 Wraps Connect method More...
 
void Close ()
 Wraps Close method More...
 

Public Attributes

bool IsOpen => _client?.State == WebSocketState.Open
 Wraps IsAlive More...
 

Protected Member Functions

virtual void OnMessage (WebSocketMessage e)
 Event invocator for the Message event More...
 
virtual void OnError (WebSocketError e)
 Event invocator for the Error event More...
 
virtual void OnOpen ()
 Event invocator for the Open event More...
 
virtual void OnClose (WebSocketCloseData e)
 Event invocator for the Close event More...
 

Events

EventHandler< WebSocketMessageMessage
 Wraps message event More...
 
EventHandler< WebSocketErrorError
 Wraps error event More...
 
EventHandler Open
 Wraps open method More...
 
EventHandler< WebSocketCloseDataClosed
 Wraps close method More...
 
- Events inherited from QuantConnect.Brokerages.IWebSocket
EventHandler< WebSocketMessageMessage
 on message event More...
 
EventHandler< WebSocketErrorError
 On error event More...
 
EventHandler Open
 On Open event More...
 
EventHandler< WebSocketCloseDataClosed
 On Close event More...
 

Additional Inherited Members

- Properties inherited from QuantConnect.Brokerages.IWebSocket
bool IsOpen [get]
 Wraps IsOpen More...
 

Detailed Description

Wrapper for System.Net.Websockets.ClientWebSocket to enhance testability

Definition at line 30 of file WebSocketClientWrapper.cs.

Member Function Documentation

◆ Initialize()

void QuantConnect.Brokerages.WebSocketClientWrapper.Initialize ( string  url,
string  sessionToken = null 
)

Wraps constructor

Parameters
urlThe target websocket url
sessionTokenThe websocket session token

Implements QuantConnect.Brokerages.IWebSocket.

Definition at line 47 of file WebSocketClientWrapper.cs.

◆ Send()

void QuantConnect.Brokerages.WebSocketClientWrapper.Send ( string  data)

Wraps send method

Parameters
data

Implements QuantConnect.Brokerages.IWebSocket.

Definition at line 57 of file WebSocketClientWrapper.cs.

◆ Connect()

void QuantConnect.Brokerages.WebSocketClientWrapper.Connect ( )

Wraps Connect method

Implements QuantConnect.Brokerages.IWebSocket.

Definition at line 69 of file WebSocketClientWrapper.cs.

Here is the call graph for this function:

◆ Close()

void QuantConnect.Brokerages.WebSocketClientWrapper.Close ( )

Wraps Close method

Implements QuantConnect.Brokerages.IWebSocket.

Definition at line 117 of file WebSocketClientWrapper.cs.

Here is the call graph for this function:

◆ OnMessage()

virtual void QuantConnect.Brokerages.WebSocketClientWrapper.OnMessage ( WebSocketMessage  e)
protectedvirtual

Event invocator for the Message event

Definition at line 180 of file WebSocketClientWrapper.cs.

◆ OnError()

virtual void QuantConnect.Brokerages.WebSocketClientWrapper.OnError ( WebSocketError  e)
protectedvirtual

Event invocator for the Error event

Parameters
e

Definition at line 189 of file WebSocketClientWrapper.cs.

Here is the call graph for this function:

◆ OnOpen()

virtual void QuantConnect.Brokerages.WebSocketClientWrapper.OnOpen ( )
protectedvirtual

Event invocator for the Open event

Definition at line 198 of file WebSocketClientWrapper.cs.

Here is the call graph for this function:

◆ OnClose()

virtual void QuantConnect.Brokerages.WebSocketClientWrapper.OnClose ( WebSocketCloseData  e)
protectedvirtual

Event invocator for the Close event

Definition at line 207 of file WebSocketClientWrapper.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ IsOpen

bool QuantConnect.Brokerages.WebSocketClientWrapper.IsOpen => _client?.State == WebSocketState.Open

Wraps IsAlive

Definition at line 155 of file WebSocketClientWrapper.cs.

Event Documentation

◆ Message

EventHandler<WebSocketMessage> QuantConnect.Brokerages.WebSocketClientWrapper.Message

Wraps message event

Definition at line 160 of file WebSocketClientWrapper.cs.

◆ Error

EventHandler<WebSocketError> QuantConnect.Brokerages.WebSocketClientWrapper.Error

Wraps error event

Definition at line 165 of file WebSocketClientWrapper.cs.

◆ Open

EventHandler QuantConnect.Brokerages.WebSocketClientWrapper.Open

Wraps open method

Definition at line 170 of file WebSocketClientWrapper.cs.

◆ Closed

EventHandler<WebSocketCloseData> QuantConnect.Brokerages.WebSocketClientWrapper.Closed

Wraps close method

Definition at line 175 of file WebSocketClientWrapper.cs.


The documentation for this class was generated from the following file: