Skip to content

Commit

Permalink
Merge pull request #24 from wmjordan/master
Browse files Browse the repository at this point in the history
Fixing typos in source code files
  • Loading branch information
somdoron authored Nov 5, 2018
2 parents 0756f9d + 4344f1a commit 6a0bf7c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Source/AsyncIO/Windows/CompletionPort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ internal void PostCompletionStatus(IntPtr overlapped)

public override bool GetMultipleQueuedCompletionStatus(int timeout, CompletionStatus[] completionStatuses, out int removed)
{
// Windows XP Has NO GetQueuedCompletionStatusEx
// so we need dequeue IOPC one by one
// Windows XP has NO GetQueuedCompletionStatusEx
// so we need dequeue IOCP one by one
#if NETSTANDARD1_3
if (false)
{
Expand Down
6 changes: 3 additions & 3 deletions Source/AsyncIO/Windows/Overlapped.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Overlapped : IDisposable
private static readonly int OffsetOffset = IntPtr.Size * 2;
private static readonly int EventOffset = IntPtr.Size * 2 + sizeof(int) * 2;

private static readonly int MangerOverlappedOffset = IntPtr.Size * 3 + sizeof(int) * 2;
private static readonly int ManagedOverlappedOffset = IntPtr.Size * 3 + sizeof(int) * 2;

private IntPtr m_address;
private GCHandle m_handle;
Expand All @@ -29,7 +29,7 @@ public Overlapped(Windows.Socket asyncSocket)

m_handle = GCHandle.Alloc(this, GCHandleType.Normal);

Marshal.WriteIntPtr(m_address, MangerOverlappedOffset, GCHandle.ToIntPtr(m_handle));
Marshal.WriteIntPtr(m_address, ManagedOverlappedOffset, GCHandle.ToIntPtr(m_handle));
}

public void Dispose()
Expand Down Expand Up @@ -78,7 +78,7 @@ public void StartOperation(OperationType operationType)

public static Overlapped CompleteOperation(IntPtr overlappedAddress)
{
IntPtr managedOverlapped = Marshal.ReadIntPtr(overlappedAddress, MangerOverlappedOffset);
IntPtr managedOverlapped = Marshal.ReadIntPtr(overlappedAddress, ManagedOverlappedOffset);

GCHandle handle = GCHandle.FromIntPtr(managedOverlapped);

Expand Down
8 changes: 4 additions & 4 deletions Source/AsyncIO/Windows/Socket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,9 @@ public void AcceptInternal(AsyncSocket socket)
{
if (m_acceptSocketBufferAddress == IntPtr.Zero)
{
m_acceptSocketBufferSize = (m_boundAddress.Size + 16) * 2;
m_acceptSocketBufferSize = m_boundAddress.Size + 16;

m_acceptSocketBufferAddress = Marshal.AllocHGlobal(m_acceptSocketBufferSize);
m_acceptSocketBufferAddress = Marshal.AllocHGlobal(m_acceptSocketBufferSize << 1);
}

int bytesReceived;
Expand All @@ -518,8 +518,8 @@ public void AcceptInternal(AsyncSocket socket)
m_inOverlapped.StartOperation(OperationType.Accept);

if (!m_acceptEx(Handle, m_acceptSocket.Handle, m_acceptSocketBufferAddress, 0,
m_acceptSocketBufferSize / 2,
m_acceptSocketBufferSize / 2, out bytesReceived, m_inOverlapped.Address))
m_acceptSocketBufferSize,
m_acceptSocketBufferSize, out bytesReceived, m_inOverlapped.Address))
{
var socketError = (SocketError)Marshal.GetLastWin32Error();

Expand Down
2 changes: 1 addition & 1 deletion Source/AsyncIO/Windows/UnsafeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static extern bool GetQueuedCompletionStatus(IntPtr completionPort, out i

[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool GetQueuedCompletionStatusEx(IntPtr completionPort, IntPtr completionPortEntries,
int count, out int removoed, int milliseconds, bool alertable);
int count, out int removed, int milliseconds, bool alertable);

[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool PostQueuedCompletionStatus(IntPtr completionPort, int numberOfBytesTransferred,
Expand Down

0 comments on commit 6a0bf7c

Please sign in to comment.