Table of Contents

Class WebSocketServer

Namespace
OpenQA.Selenium.Safari.Internal
Assembly
WebDriver.dll

Provides an implementation of a WebSocket server.

public class WebSocketServer : IWebSocketServer, IDisposable
Inheritance
WebSocketServer
Implements
Inherited Members

Constructors

WebSocketServer(int, string)

Initializes a new instance of the WebSocketServer class.

public WebSocketServer(int port, string location)

Parameters

port int

The port on which to listen for connections.

location string

The location at which to listen for connections.

WebSocketServer(string)

Initializes a new instance of the WebSocketServer class.

public WebSocketServer(string location)

Parameters

location string

The location at which to listen for connections.

Properties

Certificate

Gets or sets the certificate used for authentication.

public string Certificate { get; set; }

Property Value

string

IsSecure

Gets a value indicating whether the connection is secure.

public bool IsSecure { get; }

Property Value

bool

ListenerSocket

Gets or sets the ISocket on which communication occurs.

public ISocket ListenerSocket { get; set; }

Property Value

ISocket

Location

Gets the location the server is listening on for connections.

public string Location { get; }

Property Value

string

Port

Gets the port the server is listening on for connections.

public int Port { get; }

Property Value

int

Methods

Dispose()

Releases all resources used by the WebSocketServer.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the SocketWrapper and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release managed and resources; false to only release unmanaged resources.

OnConnectionClosed(ConnectionEventArgs)

Raises the ConnectionClosed event.

protected void OnConnectionClosed(ConnectionEventArgs e)

Parameters

e ConnectionEventArgs

A ConnectionEventArgs that contains the event data.

OnConnectionOpened(ConnectionEventArgs)

Raises the ConnectionOpened event.

protected void OnConnectionOpened(ConnectionEventArgs e)

Parameters

e ConnectionEventArgs

A ConnectionEventArgs that contains the event data.

OnErrorOccurred(ErrorEventArgs)

Raises the ErrorOccurred event.

protected void OnErrorOccurred(ErrorEventArgs e)

Parameters

e ErrorEventArgs

An ErrorEventArgs that contains the event data.

OnMessageReceived(TextMessageHandledEventArgs)

Raises the MessageReceived event.

protected void OnMessageReceived(TextMessageHandledEventArgs e)

Parameters

e TextMessageHandledEventArgs

A TextMessageHandledEventArgs that contains the event data.

OnStandardHttpRequestReceived(StandardHttpRequestReceivedEventArgs)

Raises the StandardHttpRequestReceived event.

protected void OnStandardHttpRequestReceived(StandardHttpRequestReceivedEventArgs e)

Parameters

e StandardHttpRequestReceivedEventArgs

A StandardHttpRequestReceivedEventArgs that contains the event data.

Start()

Starts the server.

public void Start()

Events

Closed

Event raised when a connection is closed.

public event EventHandler<ConnectionEventArgs> Closed

Event Type

EventHandler<ConnectionEventArgs>

ErrorOccurred

Event raised when an error occurs.

public event EventHandler<ErrorEventArgs> ErrorOccurred

Event Type

EventHandler<ErrorEventArgs>

MessageReceived

Event raised when a message is received from the WebSocket.

public event EventHandler<TextMessageHandledEventArgs> MessageReceived

Event Type

EventHandler<TextMessageHandledEventArgs>

Opened

Event raised when a connection is opened.

public event EventHandler<ConnectionEventArgs> Opened

Event Type

EventHandler<ConnectionEventArgs>

StandardHttpRequestReceived

Event raised when a non-WebSocket message is received.

public event EventHandler<StandardHttpRequestReceivedEventArgs> StandardHttpRequestReceived

Event Type

EventHandler<StandardHttpRequestReceivedEventArgs>