Table of Contents

Class SocketWrapper

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

Provides a wrapper around a Socket.

public class SocketWrapper : ISocket, IDisposable
Inheritance
SocketWrapper
Implements
Inherited Members

Constructors

SocketWrapper(Socket)

Initializes a new instance of the SocketWrapper class.

public SocketWrapper(Socket socket)

Parameters

socket Socket

The Socket to wrap.

Properties

Connected

Gets a value indicating whether the socket is connected.

public bool Connected { get; }

Property Value

bool

RemoteIPAddress

Gets the remote IP address of the socket connection.

public string RemoteIPAddress { get; }

Property Value

string

Stream

Gets a stream for reading and writing data.

public Stream Stream { get; }

Property Value

Stream

Methods

Accept()

Accepts a connection for the socket.

public void Accept()

Authenticate(X509Certificate2)

Authenticates over the socket.

public void Authenticate(X509Certificate2 certificate)

Parameters

certificate X509Certificate2

An X509Certificate2 that specifies authentication information.

Bind(EndPoint)

Binds the socket to a local end point.

public void Bind(EndPoint localEndPoint)

Parameters

localEndPoint EndPoint

The local end point to which to bind the socket.

Close()

Closes the socket connection.

public void Close()

Dispose()

Releases all resources used by the SocketWrapper.

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.

Listen(int)

Starts listening to data received over the socket.

public void Listen(int backlog)

Parameters

backlog int

The number of pending connections to process.

OnAcceptError(ErrorEventArgs)

Raises the AcceptError event.

protected void OnAcceptError(ErrorEventArgs e)

Parameters

e ErrorEventArgs

An ErrorEventArgs that contains the event data.

OnAccepted(AcceptEventArgs)

Raises the Accepted event.

protected void OnAccepted(AcceptEventArgs e)

Parameters

e AcceptEventArgs

An AcceptEventArgs that contains the event data.

OnAuthenticateError(ErrorEventArgs)

Raises the AuthenticateError event.

protected void OnAuthenticateError(ErrorEventArgs e)

Parameters

e ErrorEventArgs

An ErrorEventArgs that contains the event data.

OnAuthenticated(EventArgs)

Raises the Authenticated event.

protected void OnAuthenticated(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

OnReceiveError(ErrorEventArgs)

Raises the ReceiveError event.

protected void OnReceiveError(ErrorEventArgs e)

Parameters

e ErrorEventArgs

An ErrorEventArgs that contains the event data.

OnReceived(ReceivedEventArgs)

Raises the Received event.

protected void OnReceived(ReceivedEventArgs e)

Parameters

e ReceivedEventArgs

A ReceivedEventArgs that contains the event data.

OnSendError(ErrorEventArgs)

Raises the SendError event.

protected void OnSendError(ErrorEventArgs e)

Parameters

e ErrorEventArgs

An ErrorEventArgs that contains the event data.

OnSent(EventArgs)

Raises the Sent event.

protected void OnSent(EventArgs e)

Parameters

e EventArgs

An EventArgs that contains the event data.

Receive(byte[], int)

Receives data over the socket.

public void Receive(byte[] buffer, int offset)

Parameters

buffer byte[]

The buffer into which the data will be read.

offset int

The offset into the buffer at which the data will be read.

Send(byte[])

Sends data over the socket.

public void Send(byte[] buffer)

Parameters

buffer byte[]

The data to be sent.

Events

AcceptError

Event raised when an error occurs accepting a connection.

public event EventHandler<ErrorEventArgs> AcceptError

Event Type

EventHandler<ErrorEventArgs>

Accepted

Event raised when a connection is accepted by the socket.

public event EventHandler<AcceptEventArgs> Accepted

Event Type

EventHandler<AcceptEventArgs>

AuthenticateError

Event raised when there is an error authenticating over the socket.

public event EventHandler<ErrorEventArgs> AuthenticateError

Event Type

EventHandler<ErrorEventArgs>

Authenticated

Event raised when authentication is completed over the socket.

public event EventHandler Authenticated

Event Type

EventHandler

ReceiveError

Event raised when there is an error receiving data.

public event EventHandler<ErrorEventArgs> ReceiveError

Event Type

EventHandler<ErrorEventArgs>

Received

Event raised when data is received by the socket.

public event EventHandler<ReceivedEventArgs> Received

Event Type

EventHandler<ReceivedEventArgs>

SendError

Event raised when there is an error sending data.

public event EventHandler<ErrorEventArgs> SendError

Event Type

EventHandler<ErrorEventArgs>

Sent

Event raised when data is sent through the socket.

public event EventHandler Sent

Event Type

EventHandler