Beispiel #1
0
        internal void SendInternal(ArraySegment <byte> payload, bool noMerge)
        {
#if ALLOW_CONNECTION_STUB
            if (IsStub)
            {
                // NOOP
                return;
            }
#endif

            LastMessageOut = NetTime.Now;

            bool merged = false;

            if (!Socket.Config.EnablePacketMerging || noMerge || !(merged = Merger.TryWrite(payload)))
            {
                if (Socket.Simulator != null)
                {
                    Socket.Simulator.Add(this, payload);
                }
                else
                {
                    Socket.SendRaw(EndPoint, payload);
                }
            }
        }