# TrySend

> Attempts to send data from the Editor to the connected Players.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Networking.PlayerConnection](/engine/6000.7/script-reference/unityeditor/networking/playerconnection.md)
* **Assembly:** UnityEditor.CoreModule

## TrySend(Guid, byte\[], int)

Attempts to send data from the Editor to the connected Players.

```csharp
public bool TrySend(Guid messageId, byte[] data, int playerId)
```

### Parameters

**** (\[Guid]\(https\://learn.microsoft.com/dotnet/api/system.guid)): The type ID of the message to send to the connected Players.**** (\[byte\[]]\(https\://learn.microsoft.com/dotnet/api/system.byte)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The ID of the Player that you want to sent this message to. If you want to send it to all Players, set this to 0..

### Returns

| Type                                                          | Description                                                                                                                        |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true when the Editor sends data successfully, and false when there is no space in the socket ring buffer or sending fails. |

## TrySend(Guid, byte\[])

Attempts to send data from the Editor to the connected Players.

```csharp
public bool TrySend(Guid messageId, byte[] data)
```

### Parameters

**** (\[Guid]\(https\://learn.microsoft.com/dotnet/api/system.guid)): The type ID of the message to send to the connected Players.**** (\[byte\[]]\(https\://learn.microsoft.com/dotnet/api/system.byte)):&#x20;

### Returns

| Type                                                          | Description                                                                                                                        |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true when the Editor sends data successfully, and false when there is no space in the socket ring buffer or sending fails. |
