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

Parameters

hostId Host ID associated with this connection.
connectionId The connection ID of the connection you want to close.
error Error (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.