Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // serialize the endpoint to a SocketAddress and create an array to hold the values. Pin the array.
- SocketAddress socketAddress = ipEndPoint.Serialize();
- byte[] socketBytes = new byte[socketAddress.Size];
- GCHandle handleSocketAddress = GCHandle.Alloc(socketBytes, GCHandleType.Pinned);
- // Should copy the first 16 bytes (the SocketAddress has a 32 byte buffer, the size will only be 16, which is what the SOCKADDR accepts
- for (int i = 0; i < socketAddress.Size; ++i)
- {
- socketBytes[i] = socketAddress[i];
- }
Add Comment
Please, Sign In to add comment