Skip to content

Commit 91c2d58

Browse files
committed
move another magic number out
1 parent bcd94a4 commit 91c2d58

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Libuv/TcpSocket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public TcpSocket(IntPtr ServerHandle)
104104
}
105105
public void Write(byte[] data, int length)
106106
{
107-
IntPtr write_request = Marshal.AllocHGlobal(68);
107+
IntPtr write_request = Marshal.AllocHGlobal(Sizes.WriteTSize);
108108
var dataptrhandle = GCHandle.Alloc(data, GCHandleType.Pinned);
109109
// This is not being freed, which needs to be fixed
110110
IntPtr dat = dataptrhandle.AddrOfPinnedObject();

src/Libuv/UV.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public static class Sizes {
110110
public static readonly int TcpTSize = 152;
111111
public static readonly int ShutdownTSize = 16;
112112
public static readonly int ConnectTSize = 24;
113+
public static readonly int WriteTSize = 68;
113114
}
114115
#if __MonoCS__
115116
public struct uv_buf_t

0 commit comments

Comments
 (0)