Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ private Stream TryConnectToProcess(int nodeProcessId, int timeout, Handshake han

CommunicationsUtilities.Trace("Reading handshake from pipe {0}", pipeName);

#if NETCOREAPP2_1 || MONO
#if NETCOREAPP2_1_OR_GREATER || MONO
nodeStream.ReadEndOfHandshakeSignal(true, timeout);
#else
nodeStream.ReadEndOfHandshakeSignal(true);
Expand Down
2 changes: 0 additions & 2 deletions src/MSBuild.UnitTests/ValidateAssemblyLoadContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public override bool Execute()
// This probably doesn't need to be how it is forever: https://github.com/microsoft/msbuild/issues/5041
if (thisLoadContext.GetType().FullName == typeof(MSBuildLoadContext).FullName)
{
#if NETCOREAPP && !NETCOREAPP2_1 // TODO: enable this functionality when targeting .NET Core 3.0+
if (!thisLoadContext.Name.EndsWith(typeof(ValidateAssemblyLoadContext).Assembly.GetName().Name + ".dll"))
{
Log.LogError($"Unexpected AssemblyLoadContext name: \"{thisLoadContext.Name}\", but the current executing assembly was {typeof(ValidateAssemblyLoadContext).Assembly.GetName().Name}");
Expand All @@ -32,7 +31,6 @@ public override bool Execute()
{
Log.LogMessage(MessageImportance.High, $"Task {nameof(ValidateAssemblyLoadContext)} loaded in AssemblyLoadContext named {thisLoadContext.Name}");
}
#endif
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions src/Shared/CommunicationsUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,14 @@ internal static void WriteIntForHandshake(this PipeStream stream, int value)
}

internal static void ReadEndOfHandshakeSignal(this PipeStream stream, bool isProvider
#if NETCOREAPP2_1 || MONO
#if NETCOREAPP2_1_OR_GREATER || MONO
, int timeout
#endif
)
{
// Accept only the first byte of the EndOfHandshakeSignal
int valueRead = stream.ReadIntForHandshake(null
#if NETCOREAPP2_1 || MONO
#if NETCOREAPP2_1_OR_GREATER || MONO
, timeout
#endif
);
Expand All @@ -363,14 +363,14 @@ internal static void ReadEndOfHandshakeSignal(this PipeStream stream, bool isPro
/// If specified, leading byte matches one in the supplied array if any, returns rejection byte and throws IOException.
/// </summary>
internal static int ReadIntForHandshake(this PipeStream stream, byte? byteToAccept
#if NETCOREAPP2_1 || MONO
#if NETCOREAPP2_1_OR_GREATER || MONO
, int timeout
#endif
)
{
byte[] bytes = new byte[4];

#if NETCOREAPP2_1 || MONO
#if NETCOREAPP2_1_OR_GREATER || MONO
if (!NativeMethodsShared.IsWindows)
{
// Enforce a minimum timeout because the Windows code can pass
Expand Down
6 changes: 3 additions & 3 deletions src/Shared/NodeEndpointOutOfProcBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal abstract class NodeEndpointOutOfProcBase : INodeEndpoint
{
#region Private Data

#if NETCOREAPP2_1 || MONO
#if NETCOREAPP2_1_OR_GREATER || MONO
/// <summary>
/// The amount of time to wait for the client to connect to the host.
/// </summary>
Expand Down Expand Up @@ -386,7 +386,7 @@ private void PacketPumpProc()
for (int i = 0; i < handshakeComponents.Length; i++)
{
int handshakePart = _pipeServer.ReadIntForHandshake(i == 0 ? (byte?)CommunicationsUtilities.handshakeVersion : null /* this will disconnect a < 16.8 host; it expects leading 00 or F5 or 06. 0x00 is a wildcard */
#if NETCOREAPP2_1 || MONO
#if NETCOREAPP2_1_OR_GREATER || MONO
, ClientConnectTimeout /* wait a long time for the handshake from this side */
#endif
);
Expand All @@ -403,7 +403,7 @@ private void PacketPumpProc()
if (gotValidConnection)
{
// To ensure that our handshake and theirs have the same number of bytes, receive and send a magic number indicating EOS.
#if NETCOREAPP2_1 || MONO
#if NETCOREAPP2_1_OR_GREATER || MONO
_pipeServer.ReadEndOfHandshakeSignal(false, ClientConnectTimeout); /* wait a long time for the handshake from this side */
#else
_pipeServer.ReadEndOfHandshakeSignal(false);
Expand Down