private static async Task <Connection> ConnectPortfileURLAsync(string connectionuri)
        {
            Connection connection = null;

            if (connectionuri.StartsWith("local:"))
            {
                connection = await SBTProcess.ConnectNamedPipeAsync(connectionuri);
            }
            else if (connectionuri.StartsWith("tcp:"))
            {
                connection = await SBTProcess.ConnectTCPAsync(connectionuri);
            }
            return(connection);
        }
        private async Task <Connection> ConnectToWorkingDirectoryAsync(string workingdirectory, CancellationToken token)
        {
            var(connectionuri, ctoken) = await SBTProcess.WaitForConnectionUriAndTokenAsync(workingdirectory, token);

            if (connectionuri == null)
            {
                return(null);
            }
            else
            {
                connectionToken = ctoken;
                return(await ConnectPortfileURLAsync(connectionuri));
            }
        }