1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 02:11:06 +09:00

Rev397-400 on google code; fixes to recycling and minor tweak to heartbeat calling when a disconnection occurs

This commit is contained in:
Michael Lidgren
2015-01-25 16:05:49 +01:00
parent 4b7b53b36d
commit 5879fb641e
12 changed files with 56 additions and 49 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace Lidgren.Network
{
@@ -160,7 +161,7 @@ namespace Lidgren.Network
om.Write(m_peerConfiguration.AppIdentifier);
om.Write(m_peer.m_uniqueIdentifier);
om.Write((float)now);
Interlocked.Increment(ref om.m_recyclingCount);
WriteLocalHail(om);
if (onLibraryThread)
@@ -184,6 +185,7 @@ namespace Lidgren.Network
NetOutgoingMessage om = m_peer.CreateMessage(reason);
om.m_messageType = NetMessageType.Disconnect;
Interlocked.Increment(ref om.m_recyclingCount);
if (onLibraryThread)
m_peer.SendLibrary(om, m_remoteEndPoint);
else