Class WebSocketTransfer
Base class that defines methods for transferring content over the WebSocket protocol.
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public abstract class WebSocketTransfer : object
Constructors
WebSocketTransfer(String)
Initializes a new instance of the WebSocketTransfer class.
Declaration
public WebSocketTransfer(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The URL. |
Properties
HandshakeTimeout
Gets or sets the timeout for the initial handshake (in ms).
Declaration
public int HandshakeTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
OnOpenFailure
Gets or sets the callback to invoke if the handshake fails.
Declaration
public Action1<WebSocketOpenFailureArgs> OnOpenFailure { get; set; }
Property Value
Type | Description |
---|---|
Action1<WebSocketOpenFailureArgs> |
OnOpenSuccess
Gets or sets the callback to invoke if the handshake succeeds.
Declaration
public Action1<WebSocketOpenSuccessArgs> OnOpenSuccess { get; set; }
Property Value
Type | Description |
---|---|
Action1<WebSocketOpenSuccessArgs> |
OnRequestCreated
Gets or sets the callback to invoke when the handshake request is created.
Declaration
public Action1<HttpRequestCreatedArgs> OnRequestCreated { get; set; }
Property Value
Type | Description |
---|---|
Action1<HttpRequestCreatedArgs> |
OnResponseReceived
Gets or sets the callback to invoke when the handshake response is received.
Declaration
public Action1<HttpResponseReceivedArgs> OnResponseReceived { get; set; }
Property Value
Type | Description |
---|---|
Action1<HttpResponseReceivedArgs> |
OnStreamFailure
Gets or sets the callback to invoke if the stream errors out.
Declaration
public Action1<WebSocketStreamFailureArgs> OnStreamFailure { get; set; }
Property Value
Type | Description |
---|---|
Action1<WebSocketStreamFailureArgs> |
Sender
Gets or sets the sender of the messages.
Declaration
public object Sender { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
StreamTimeout
Gets or sets the timeout for the stream (in ms).
Declaration
public int StreamTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Url
Gets or sets the URL.
Declaration
public string Url { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Open(NameValueCollection)
Opens the socket.
Declaration
public abstract void Open(NameValueCollection headers)
Parameters
Type | Name | Description |
---|---|---|
NameValueCollection | headers | The headers to pass in with the initial handshake. |
Send(HttpRequestArgs)
Sends a request synchronously.
Declaration
public abstract HttpResponseArgs Send(HttpRequestArgs requestArgs)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestArgs | requestArgs | The request parameters. |
Returns
Type | Description |
---|---|
HttpResponseArgs | The response parameters. |
SendAsync(HttpRequestArgs, Action1<HttpResponseArgs>)
Sends a request asynchronously.
Declaration
public abstract void SendAsync(HttpRequestArgs requestArgs, Action1<HttpResponseArgs> callback)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestArgs | requestArgs | The request parameters. |
Action1<HttpResponseArgs> | callback | The callback to execute with the resulting response. |
Shutdown()
Releases any resources and shuts down.
Declaration
public abstract void Shutdown()