Version: 2018.1
public static bool Disconnect (int hostId, int connectionId, out byte error);

Parameters

hostIdHost ID associated with this connection.
connectionIdThe connection ID of the connection you want to close.
errorError (can be cast to NetworkError for more information).

Description

Send a disconnect signal to the connected peer and close the connection. Poll NetworkTransport.Receive() to be notified that the connection is closed. This signal is only sent once (best effort delivery). If this packet is dropped for some reason, the peer closes the connection by timeout.