websocket-sharp : WebSocketSharp Namespace

# CloseEventArgs Class

Contains the event data associated with a WebSocket.OnClose event.

## Syntax

public class CloseEventArgs : MessageEventArgs

## Remarks

The WebSocket.OnClose event occurs when the WebSocket receives a close control frame or the `WebSocket.Close` method is called. If you want to get the reason for closure, you should access the CloseEventArgs.Code or CloseEventArgs.Reason properties.

## Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

## Members

See Also: Inherited members from MessageEventArgs.

## Public Properties

[read-only] | Code | ushort . Gets the status code for closure.
[read-only] | Data | string . Gets the received data as a string. (Inherited from MessageEventArgs.)
[read-only] | RawData | byte[]. Gets the received data as an array of byte. (Inherited from MessageEventArgs.)
[read-only] | Reason | string . Gets the reason for closure.
[read-only] | Type | Opcode . Gets the type of received data. (Inherited from MessageEventArgs.)
[read-only] | WasClean | bool . Indicates whether the connection closed cleanly or not.

## Extension Methods

static | IsNull<T> (this T) : bool Determines whether the specified object is `null`.
static | IsNullDo<T> (this T, Action) : bool Determines whether the specified object is `null`. And invokes the specified Action delegate if the specified object is `null`.

## Member Details

### Code Property

> Gets the status code for closure.

> ## Syntax

> public ushort Code { get; }

> #### Value

> > A ushort that contains a status code for closure.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp
> Assembly: websocket-sharp (in websocket-sharp.dll)

### Reason Property

> Gets the reason for closure.

> ## Syntax

> public string Reason { get; }

> #### Value

> > A string that contains a reason for closure.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp
> Assembly: websocket-sharp (in websocket-sharp.dll)

### WasClean Property

> Indicates whether the connection closed cleanly or not.

> ## Syntax

> public bool WasClean { get; }

> #### Value

> > `true` if the connection closed cleanly; otherwise, `false`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp
> Assembly: websocket-sharp (in websocket-sharp.dll)