> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# RakNetSignalConnection.Disconnect

> Disconnects a connection returned by RakNet.OnPacketSend.Connect or RakNet.OnPacketReceive.Connect. The method returns no values.

<div className="real-function-page">
  ```lua theme={null}
  RakNetSignalConnection.Disconnect(connection: RakNetSignalConnection)
  ```

  ## Аргументы

  <ParamField path={"connection"} type={"RakNetSignalConnection"} required>
    Connection object returned by a RakNet packet signal Connect call.
  </ParamField>

  ## Типы

  ### RakNetSignalConnection

  Connection object returned by RakNet.OnPacketSend.Connect and RakNet.OnPacketReceive.Connect.

  | Name         | Type       | Required | Описание                                                                       |
  | ------------ | ---------- | -------- | ------------------------------------------------------------------------------ |
  | `Disconnect` | `() -> ()` | Yes      | Removes the connection from the packet signal.                                 |
  | `Connected`  | `boolean`  | Yes      | true while the connection still exists for the current RakNet hook generation. |

  ## Пример

  Disconnect a RakNet packet signal connection.

  ```lua theme={null}
  if RakNet.is_enabled then
      local connection = RakNet.OnPacketSend:Connect(function(packet)
          print(packet.Size)
      end)

      connection:Disconnect()
      print(connection.Connected)
  end
  ```
</div>
