# Sandbox.WebSocket.Send

## Overload 1

```csharp
System.Threading.Tasks.ValueTask Send(string message)
```

Sends a text message to the WebSocket server.

### Parameters

- `message` (`string`): The message text to send. Must not be null.

### Returns

`System.Threading.Tasks.ValueTask`: A `T:System.Threading.Tasks.ValueTask` which completes when the message was queued to be sent.

## Overload 2

```csharp
System.Threading.Tasks.ValueTask Send(byte[] data)
```

Sends a binary message to the WebSocket server.

## Remarks

The `M:Sandbox.WebSocket.Send(System.ArraySegment{System.Byte})` and `M:Sandbox.WebSocket.Send(System.Span{System.Byte})` overloads allow sending subsections of byte arrays.

### Parameters

- `data` (`byte[]`): The message data to send. Must not be null.

### Returns

`System.Threading.Tasks.ValueTask`: A `T:System.Threading.Tasks.ValueTask` which completes when the message was queued to be sent.

## Overload 3

```csharp
System.Threading.Tasks.ValueTask Send(System.ArraySegment<byte> data)
```

### Parameters

- `data` (`System.ArraySegment<byte>`)

### Returns

`System.Threading.Tasks.ValueTask`

## Overload 4

```csharp
System.Threading.Tasks.ValueTask Send(System.Span<byte> data)
```

### Parameters

- `data` (`System.Span<byte>`)

### Returns

`System.Threading.Tasks.ValueTask`

Declared in [Sandbox.WebSocket](/api/Sandbox.WebSocket).
Assembly: `Sandbox.Engine`.
