private void SendHeartbeat()
        {
            SocketError errorCode;

            while (true)
            {
                Thread.Sleep(heartbeatInterval);
                tcpClient.Send(heartbeatMsg.Packet, out errorCode);

                if (errorCode != SocketError.Success)
                {
                    if (Interlocked.Exchange(ref tcpSocketState, -1) != -1)
                    {
                        tcpClient.ReconnectSocket(heartbeatMsg);
                    }
                    break;
                }
            }
        }