예제 #1
0
        private void LogBuffer(int size)
        {
            if (!SocketsEventSource.Log.IsEnabled() && GlobalLog.IsEnabled)
            {
                GlobalLog.AssertFormat("OverlappedAsyncResult#{0}::LogBuffer()|Logging is off!", LoggingHash.HashString(this));
            }

            if (size > -1)
            {
                if (_wsaBuffers != null)
                {
                    foreach (WSABuffer wsaBuffer in _wsaBuffers)
                    {
                        SocketsEventSource.Dump(SocketsEventSource.MethodType.PostCompletion, wsaBuffer.Pointer, Math.Min(wsaBuffer.Length, size));
                        if ((size -= wsaBuffer.Length) <= 0)
                        {
                            break;
                        }
                    }
                }
                else
                {
                    SocketsEventSource.Dump(SocketsEventSource.MethodType.PostCompletion, _singleBuffer.Pointer, Math.Min(_singleBuffer.Length, size));
                }
            }
        }
예제 #2
0
 private void LogBuffer(int size)
 {
     if (!SocketsEventSource.Log.IsEnabled() && GlobalLog.IsEnabled)
     {
         GlobalLog.AssertFormat("ReceiveMessageOverlappedAsyncResult#{0}::LogBuffer()|Logging is off!", LoggingHash.HashString(this));
     }
     SocketsEventSource.Dump(SocketsEventSource.MethodType.PostCompletion, _wsaBuffer->Pointer, Math.Min(_wsaBuffer->Length, size));
 }
예제 #3
0
 internal void LogBuffer(int size)
 {
     if (_buffer != null)
     {
         SocketsEventSource.Dump(_buffer, _offset, size);
     }
     else if (_acceptBuffer != null)
     {
         SocketsEventSource.Dump(_acceptBuffer, 0, size);
     }
 }
예제 #4
0
 private void LogBuffer(int size)
 {
     if (!SocketsEventSource.Log.IsEnabled())
     {
         if (GlobalLog.IsEnabled)
         {
             GlobalLog.AssertFormat("ReceiveMessageOverlappedAsyncResult#{0}::LogBuffer()|Logging is off!", LoggingHash.HashString(this));
         }
         Debug.Fail("ReceiveMessageOverlappedAsyncResult#" + LoggingHash.HashString(this) + "::LogBuffer()|Logging is off!");
     }
     SocketsEventSource.Dump(_wsaBuffer->Pointer, Math.Min(_wsaBuffer->Length, size));
 }
예제 #5
0
        private void LogBuffer(long size)
        {
            GlobalLog.Assert(SocketsEventSource.Log.IsEnabled(), "AcceptOverlappedAsyncResult#{0}::LogBuffer()|Logging is off!", LoggingHash.HashString(this));
            IntPtr pinnedBuffer = Marshal.UnsafeAddrOfPinnedArrayElement(_buffer, 0);

            if (pinnedBuffer != IntPtr.Zero)
            {
                if (size > -1)
                {
                    SocketsEventSource.Dump(SocketsEventSource.MethodType.PostCompletion, pinnedBuffer, (int)Math.Min(size, (long)_buffer.Length));
                }
                else
                {
                    SocketsEventSource.Dump(SocketsEventSource.MethodType.PostCompletion, pinnedBuffer, (int)_buffer.Length);
                }
            }
        }
예제 #6
0
        private void LogBuffer(long size)
        {
            if (!SocketsEventSource.Log.IsEnabled())
            {
                if (GlobalLog.IsEnabled)
                {
                    GlobalLog.AssertFormat("AcceptOverlappedAsyncResult#{0}::LogBuffer()|Logging is off!", LoggingHash.HashString(this));
                }
                Debug.Fail("AcceptOverlappedAsyncResult#" + LoggingHash.HashString(this) + "::LogBuffer()|Logging is off!");
            }
            IntPtr pinnedBuffer = Marshal.UnsafeAddrOfPinnedArrayElement(_buffer, 0);

            if (pinnedBuffer != IntPtr.Zero)
            {
                if (size > -1)
                {
                    SocketsEventSource.Dump(pinnedBuffer, (int)Math.Min(size, (long)_buffer.Length));
                }
                else
                {
                    SocketsEventSource.Dump(pinnedBuffer, (int)_buffer.Length);
                }
            }
        }