SocketClient.OnDisconnected C# (CSharp) Method

OnDisconnected() private method

private OnDisconnected ( DisType dis, string msg ) : void
dis DisType
msg string
return void
    private void OnDisconnected(DisType dis, string msg)
    {
        //关掉客户端链接
        Close();
        int protocal = dis == DisType.Exception ? Protocal.Exception : Protocal.Disconnect;
        ByteBuffer buffer = new ByteBuffer();
        buffer.WriteShort((ushort)protocal);
        NetworkManager.AddEvent(protocal, buffer);
        Debug.LogError("Connection was closed by the server:>" + msg + " Distype:>" + dis);
    }