2 instantiations of HandshakeResult
Microsoft.Build (2)
CommunicationsUtilities.cs (2)
199public static HandshakeResult Success(int value = 0, byte negotiatedPacketVersion = 1) => new(HandshakeStatus.Success, value, null, negotiatedPacketVersion); 207public static HandshakeResult Failure(HandshakeStatus status, string errorMessage) => new(status, 0, errorMessage);
28 references to HandshakeResult
Microsoft.Build (28)
BackEnd\Client\MSBuildClient.cs (1)
610_nodeStream, _pipeName, _handshake, Math.Max(1, timeoutMilliseconds - (int)sw.ElapsedMilliseconds), out HandshakeResult result))
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (8)
181Stream nodeStream = TryConnectToProcess(nodeProcess.Id, timeout, NodeProviderOutOfProc.GetHandshake(nodeReuse, false), out HandshakeResult result); 350Stream nodeStream = TryConnectToProcess(nodeToReuse.Id, 0 /* poll, don't wait for connections */, nodeLaunchData.Handshake, out HandshakeResult result); 417Stream nodeStream = TryConnectToProcess(msbuildProcess.Id, TimeoutForNewNodeCreation, nodeLaunchData.Handshake, out HandshakeResult result); 755private Stream TryConnectToProcess(int nodeProcessId, int timeout, Handshake handshake, out HandshakeResult result) 799result = HandshakeResult.Failure(HandshakeStatus.Undefined, "Check the COMM traces to diagnose the issue with communication."); 810internal static bool TryConnectToPipeStream(NamedPipeClientStream nodeStream, string pipeName, Handshake handshake, int timeout, out HandshakeResult result) 844out HandshakeResult innerResult)) 848result = HandshakeResult.Success(0, innerResult.NegotiatedPacketVersion);
CommunicationsUtilities.cs (17)
179/// Initializes a new instance of the <see cref="HandshakeResult"/> class. 198/// <returns>A new <see cref="HandshakeResult"/> instance representing a successful operation.</returns> 199public static HandshakeResult Success(int value = 0, byte negotiatedPacketVersion = 1) => new(HandshakeStatus.Success, value, null, negotiatedPacketVersion); 206/// <returns>A new <see cref="HandshakeResult"/> instance representing a failed operation.</returns> 207public static HandshakeResult Failure(HandshakeStatus status, string errorMessage) => new(status, 0, errorMessage); 489out HandshakeResult result) 497out HandshakeResult innerResult)) 517out HandshakeResult versionResult)) 545result = HandshakeResult.Success(0, negotiatedPacketVersion); 555private static HandshakeResult CreateVersionMismatchResult(bool isProvider, int receivedValue) 562return HandshakeResult.Failure(HandshakeStatus.VersionMismatch, errorMessage); 576out HandshakeResult result 601result = HandshakeResult.Failure(HandshakeStatus.Timeout, String.Format(CultureInfo.InvariantCulture, "Did not receive return handshake in {0}ms", timeout)); 616result = HandshakeResult.Failure(HandshakeStatus.OldMSBuild, String.Format(CultureInfo.InvariantCulture, "Client: rejected old host. Received byte {0} instead of {1}.", bytes[0], byteToAccept)); 624result = HandshakeResult.Failure(HandshakeStatus.UnexpectedEndOfStream, String.Format(CultureInfo.InvariantCulture, "Unexpected end of stream while reading for handshake")); 639result = HandshakeResult.Success(BitConverter.ToInt32(bytes, 0 /* start index */)); 643result = HandshakeResult.Failure(HandshakeStatus.EndiannessMismatch, String.Format(CultureInfo.InvariantCulture, "Failed to convert the handshake to big-endian. {0}", ex.Message));
NodeEndpointOutOfProcBase.cs (2)
423out HandshakeResult result)) 449_pipeServer.TryReadEndOfHandshakeSignal(false, ClientConnectTimeout, out HandshakeResult _)) /* wait a long time for the handshake from this side */