# SendRT(Player client, byte cmd, byte\[] buffer, bool kernel, bool serialize)

```
    /// <summary>
    /// 发送灵活数据包
    /// </summary>
    /// <param name="client">客户端集合</param>
    /// <param name="cmd"></param>
    /// <param name="buffer">要包装的数据,你自己来定</param>
    /// <param name="kernel">内核? 你包装的数据在客户端是否被内核NetConvert序列化?</param>
    /// <param name="serialize">序列化? 你包装的数据是否在服务器即将发送时NetConvert序列化?</param>
    public void SendRT(Player client, byte cmd, byte[] buffer, bool kernel, bool serialize)
    {
        if (client.CloseSend)
            return;
        if (client.tcpRPCModels.Count >= ushort.MaxValue)
        {
            Debug.LogError($"[{client.UserID}]数据缓存列表超出限制!");
            return;
        }
        if (buffer.Length / MTU > ushort.MaxValue)
        {
            Debug.LogError("数据太大，请分块发送!");
            return;
        }
        client.tcpRPCModels.Enqueue(new RPCModel(cmd, buffer, kernel, serialize) { bigData = buffer.Length > short.MaxValue });
    }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://runninghorse.gitbook.io/gdnet/net.scene/sendrt-player-client-byte-cmd-byte-buffer-bool-kernel-bool-serialize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
