Lidgren.Network.NetConnection.SendConnectResponse C# (CSharp) Method

SendConnectResponse() private method

private SendConnectResponse ( float now, bool onLibraryThread ) : void
now float
onLibraryThread bool
return void
        internal void SendConnectResponse(float now, bool onLibraryThread)
        {
            if (onLibraryThread)
                m_peer.VerifyNetworkThread();

            NetOutgoingMessage om = m_peer.CreateMessage(m_peerConfiguration.AppIdentifier.Length + 13 + (m_localHailMessage == null ? 0 : m_localHailMessage.LengthBytes));
            om.m_messageType = NetMessageType.ConnectResponse;
            om.Write(m_peerConfiguration.AppIdentifier);
            om.Write(m_peer.m_uniqueIdentifier);
            om.Write(now);

            WriteLocalHail(om);

            if (onLibraryThread)
                m_peer.SendLibrary(om, m_remoteEndPoint);
            else
                m_peer.m_unsentUnconnectedMessages.Enqueue(new NetTuple<System.Net.IPEndPoint, NetOutgoingMessage>(m_remoteEndPoint, om));

            m_lastHandshakeSendTime = now;
            m_handshakeAttempts++;

            if (m_handshakeAttempts > 1)
                m_peer.LogDebug("Resending ConnectResponse...");

            SetStatus(NetConnectionStatus.RespondedConnect, "Remotely requested connect");
        }