Class WebSocketClient
Inheritance
WebSocketClient
Assembly: KSharpPlus.dll
Syntax
public class WebSocketClient : IWebSocketClient
Properties
|
Improve this Doc
View Source
Declaration
public IReadOnlyDictionary<string, string> DefaultHeaders { get; }
Property Value
|
Improve this Doc
View Source
Proxy
Declaration
public IWebProxy Proxy { get; }
Property Value
Methods
|
Improve this Doc
View Source
Declaration
public bool AddDefaultHeader(string name, string value)
Parameters
Returns
|
Improve this Doc
View Source
ConnectAsync(Uri)
Declaration
public async Task ConnectAsync(Uri uri)
Parameters
Type |
Name |
Description |
Uri |
uri |
|
Returns
|
Improve this Doc
View Source
CreateNew(IWebProxy)
Declaration
public static IWebSocketClient CreateNew(IWebProxy proxy)
Parameters
Type |
Name |
Description |
IWebProxy |
proxy |
Proxy to use for this client instance.
|
Returns
|
Improve this Doc
View Source
DisconnectAsync(Int32, String)
Declaration
public async Task DisconnectAsync(int code = 1000, string message = "")
Parameters
Returns
|
Improve this Doc
View Source
Dispose()
Disposes of resources used by this WebSocket client instance.
Declaration
|
Improve this Doc
View Source
Declaration
public bool RemoveDefaultHeader(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
|
Improve this Doc
View Source
SendMessageAsync(String)
Declaration
public async Task SendMessageAsync(string message)
Parameters
Type |
Name |
Description |
String |
message |
|
Returns
Events
|
Improve this Doc
View Source
Connected
Triggered when the client connects successfully.
Declaration
public event AsyncEventHandler<IWebSocketClient, SocketEventArgs> Connected
Event Type
|
Improve this Doc
View Source
Disconnected
Triggered when the client is disconnected.
Declaration
public event AsyncEventHandler<IWebSocketClient, SocketCloseEventArgs> Disconnected
Event Type
|
Improve this Doc
View Source
ExceptionThrown
Triggered when an error occurs in the client.
Declaration
public event AsyncEventHandler<IWebSocketClient, SocketErrorEventArgs> ExceptionThrown
Event Type
|
Improve this Doc
View Source
MessageReceived
Triggered when the client receives a message from the remote party.
Declaration
public event AsyncEventHandler<IWebSocketClient, SocketMessageEventArgs> MessageReceived
Event Type
Implements
IDisposable